Thanks for any assistance
function onButtonClicked() script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Deep blue") script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end script.Parent.MouseButton1Click:connect(onButtonClicked)
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)