inside a localscript(put in gui same place as current script):
local Event = game:GetService("ReplicatedStorage"):WaitForChild("ChangeTeamRemote")
function onButtonClicked()
Event:FireServer(BrickColor.new("Deep blue"))
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
inside a script(put in serverscriptservice):
local Event = Instance.new("RemoteEvent")
Event.Parent = game:GetService("ReplicatedStorage")
Event.Name = "ChangeTeamRemote"
function EventFired(player,team)
player.TeamColor = team
end
Event.OnServerEvent:Connect(EventFired)
2 comments
Thanks, that works