I am trying to set two teams (thieves and police). The user can choose the team with GUI at the start of a game. When the user clicks on the GUI button for a team it does not work for some reason, and I am not getting any errors, can anyone help?
Thanks.
This is the local script located in the StarterGui:
-- Team changer GUI script
local remoteEvent = game.ReplicatedStorage.teamChanger
local teamGuiFrame = script.Parent:WaitForChild("Frame")
--Teams
local thieveColor = "Deep Orange"
local policeColor = "Deep Blue"
teamGuiFrame.ThieveButton.MouseButton1Click:Connect(function()
remoteEvent:FireServer(BrickColor.new(thieveColor))
end)
teamGuiFrame.PoliceButton.MouseButton1Click:Connect(function()
remoteEvent:FireServer(BrickColor.new(policeColor))
end)
And this is the serverSide script:
--Team Changer
game.ReplicatedStorage.teamChanger.OnServerEvent:Connect(function(player,teamColor)
player.TeamColor = teamColor
player:LoadCharacter()
end)
Here is the image of the Explorer: https://ibb.co/7KP8Jxd

2 comments
Are you receiving any errors in the Output window?
No, I am not getting any errors.