/c local player = game.player local perms = game.permissions local nowalk = perms.get_group("no-walk") local default = perms.get_group("Default") if not nowalk then nowalk = perms.create_group("no-walk") nowalk.set_allows_action(defines.input_action.start_walking, false) end local toggle_interval = 5 * 60 script.on_nth_tick(nil) local toggle_which = false toggle_which = (toggle_which and "group") or "permission" if toggle_which == "group" then nowalk.set_allows_action(defines.input_action.start_walking, false) script.on_nth_tick(toggle_interval, function() local tick = game.tick.." " if player.permission_group.name == "no-walk" then game.print(tick.."walk") player.permission_group = default else game.print(tick.."no walk") player.permission_group = nowalk end end) elseif toggle_which == "permission" then player.permission_group = nowalk script.on_nth_tick(toggle_interval, function() local walk_int = defines.input_action.start_walking local tick = game.tick.." " nowalk.set_allows_action(walk_int, not nowalk.allows_action(walk_int)) game.print(tick.."can start walking? "..tostring(nowalk.allows_action(walk_int))) end) else game.print("whoops, toggling neither way") end