So my friend and I are making a game where we throw cookies at each other and I needed to make a team change script so I followed a tutorial and it kind of works when I click red or blue it just sets my team to neutral. Thanks!
Script in server script service:
game.ReplicatedStorage["Change Team"].OnServerEvent:Connect(function(player,teamColor)
player.TeamColor = teamColor
player:LoadCharacter()
end)
local script in my gui:
local RemoteEvent = game.ReplicatedStorage["Change Team"]
local menuButton = script.Parent:WaitForChild("TextButton")
local frame = script.Parent:WaitForChild("Frame")
local BlueColor = "Really Blue"
local RedColor = "Really Red"
frame.blue.MouseButton1Click:Connect(function()
RemoteEvent:FireServer(BrickColor.new(BlueColor))
end)
frame.red.MouseButton1Click:Connect(function()
RemoteEvent:FireServer(BrickColor.new(RedColor))
end)
menuButton.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
end)

2 comments
Thanks I will try this when I get home!
OH MY GOSH IM SO DUMB THANKS