I am pretty new to scripting, and I started to work on a Team Change GUI, it works but other players don’t see the changes. I am using Remove Events, not sure if I’m doing it correctly. I will supplement some screenshots and code bars of my explorer, and my scripts.
Team change to guard. These team change localscripts are inside of the TeamGua = Guard team, and TeamInm, inmate team. (TextButtons)
local Player = game.Players.LocalPlayer
local Teams = game:GetService("Teams")
local Gui = script.Parent.Parent.Parent
local Upd = script.Parent.Parent
local Ingame = script.Parent.Parent.Parent.Parent.Ingame
script.Parent.MouseButton1Click:Connect(function()
Player.Team = Teams:FindFirstChild("Guard")
game.ReplicatedStorage.TeamChange:FireServer()
Gui.Visible = false
Upd.Visible = false
Ingame.Visible = true
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
end)
Team change to inmate
Script above, but
Player.Team = Teams:FindFirstChild("Guard")
)
Guard is replaced by Inmate.
My remove event handler in serverscriptservice
game.ReplicatedStorage.TeamChange.OnServerEvent:connect(function(Player)
Player:LoadCharacter()
end)
Some screenshots from my explorer