I have a script that handles the remote events that are in Replicated Storage and the script is in ServerScriptService. I hit a button on a gui and it disables a local script that is in PlayerGui and is supposed to change the camera type to custom and the camera subject to the player's humanoid, however, it just keeps the options that are set in the local script. When a run a test server, the server sees the local script in the player gui, but the client doesn't.
Script in ServerScriptService:
local TeamChangeEvents = game:GetService('ReplicatedStorage'):WaitForChild('TeamChangeEvents')
local TeamEastChangeClick = TeamChangeEvents:WaitForChild('TeamEastChangeClick')
local TeamWestChangeClick = TeamChangeEvents:WaitForChild('TeamWestChangeClick')
TeamEastChangeClick.OnServerEvent:connect(function(plr, button)
plr.TeamColor = BrickColor.new("Really blue")
button.Parent:TweenPosition(UDim2.new(-1.5,0,0,85), 'Out', 'Linear')
button.Parent.Parent.WestTeam:TweenPosition(UDim2.new(1.5,0,0,-85), 'Out', 'Linear')
if (plr.Character.Humanoid.RigType == Enum.HumanoidRigType.R15) then
plr.Character.UpperTorso:Destroy()
else
plr.Character.Torso:Destroy()
end
print("KILLED east")
wait(5.5)
workspace.CurrentCamera.CameraSubject = plr.Character.Humanoid
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
plr.PlayerGui:WaitForChild('SmartLock').Disabled = true
plr.Character.Humanoid.WalkSpeed = 16
plr.Character.Humanoid.JumpPower = 50
plr.Character:MoveTo(workspace.EastSpawn.Position)
end)
TeamWestChangeClick.OnServerEvent:connect(function(plr, button)
plr.TeamColor = BrickColor.new("Really red")
button.Parent:TweenPosition(UDim2.new(1.5,0,0,-85), 'Out', 'Linear')
button.Parent.Parent.EastTeam:TweenPosition(UDim2.new(-1.5,0,0,85), 'Out', 'Linear')
if (plr.Character.Humanoid.RigType == Enum.HumanoidRigType.R15) then
plr.Character.UpperTorso:Destroy()
else
plr.Character.Torso:Destroy()
end
print("KILLED east")
wait(5.5)
plr.PlayerGui:WaitForChild('SmartLock').Disabled = true
workspace.CurrentCamera.CameraSubject = plr.Character.Humanoid
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
plr.Character.Humanoid.WalkSpeed = 16
plr.Character.Humanoid.JumpPower = 50
plr.Character:MoveTo(workspace.WestSpawn.Position)
end)

4 comments
Thank you, but where should I put the local script? And can I undisable it from the script that's in ServerScriptService?
Anywhere a localscript can normally execute. Depends on if the server can access the location(so not PlayerGui)
Local Scripts work in PlayerGui. Local Scripts also work in the character, for example. Just because the server can access a location doesn't mean local scripts can't run there.
I meant that based on the fact he wants to disable it.