Lua скрипт для ограничения действий игроков на завершенных картах
local UnityEngine = CS.UnityEngine
function Update() if Player.IsAdmin then Player:EnableFly(true) Player:EnableSpeedUp(true) Game.TeleportToPlayers = true elseif Player.IsModerator then Player:EnableFly(true) Game.TeleportToPlayers = true if Player.IsBuilder then Player:EnableSpeedUp(true) Player.RaycastDistance = 0 else Player:EnableSpeedUp(false) Player.RaycastDistance = 7 if Player.IsSpeedUp or (UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode.Alpha1) and Chat.IsEnable==false) then Player:EnableSpeedUp(false) Chat:AddMessage('Быстро бегать могут те, кому разрешено 'строить'.', '[708090]') end end else if Player.IsBuilder then Player:EnableSpeedUp(true) Player.RaycastDistance = 0 else Player.RaycastDistance = 7 if Player.IsFlying or (UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode.Alpha2) and Chat.IsEnable==false) then Player:EnableFly(false) Chat:AddMessage('Летать могут модераторы.', '[708090]') end if Player.IsSpeedUp or (UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode.Alpha1) and Chat.IsEnable==false) then Player:EnableSpeedUp(false) Chat:AddMessage('Быстро бегать могут те, кому разрешено 'строить'.', '[708090]') end if Game.TeleportToPlayers then Game.TeleportToPlayers = false end end end end end
function OnDestroy() Player.RaycastDistance = 7 Player:EnableFly(true) Player:EnableSpeedUp(true) Game.TeleportToPlayers = true Chat:AddMessage('Мод отключен, все запреты сняты!', '[4682B4]') end
function DontDestroyOnLoad(gameObject) UnityEngine.Object.DontDestroyOnLoad(gameObject) end
Chat:AddMessage('Mod for completed maps to pass - Активирован!', '[4682B4]') Chat:AddMessage('Узнать информацию о моде на клавишу i.', '[4682B4]')
原文地址: https://www.cveoy.top/t/topic/nanF 著作权归作者所有。请勿转载和采集!