Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Team change script for my game isnt working?

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)

1 answer

✓ Accepted answer

The second word of the BrickColor names should not have a capital letter.

Please reference this article on how BrickColor names are capitalized.

2 comments

0

Thanks I will try this when I get home!

0

OH MY GOSH IM SO DUMB THANKS

This discussion is preserved as it was. New answers, comments, and votes are closed.