You see, I've been making a main menu gui and the teleporting works and team changing etc. However, when I try to hide the gui so the player can actually play, it doesn't do anything. My local script is inside the gui so I figured that if I try hide the gui it'll also disable the script that lets the team changing script work. I'm not exactly sure where to place my local script either as filteringenabled doesn't let you use LocalPlayer. I'll provide the scripts. Local Script:
local event = game:GetService("ReplicatedStorage"):WaitForChild("StartMenu")
script.Parent.MouseButton1Down:connect(function()
game.ReplicatedStorage.StartMenu:FireServer() --StartMenu is a RemoteEvent.
end)
Normal Script (located in serverscriptservice):
local event = game:GetService("ReplicatedStorage"):WaitForChild('StartMenu')
event.OnServerEvent:connect(function(player)
print("Someone pressed the button!")
player.TeamColor = BrickColor.new("Persimmon")
player.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(15.31,85.839,32.044))
player.Character.Humanoid.JumpPower = 50
player.Character.Humanoid.WalkSpeed = 16
player.PlayerGui.MenuStart.Enabled = false --Renamed to avoid confusion.
end)

2 comments
If I put it in a localscript I'd get the error 'OnServerEvent can only be used on the server'.
No, the editing the UI part, not the rest of script. Can you please make a little common sense?