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

Change Teams button not working both ways?

local player = game.Players.LocalPlayer
local Teams = game:GetService("Teams")
local RedTeam = Teams:WaitForChild("RedTeam")
local YellowTeam = Teams:WaitForChild("YellowTeam")

script.Parent.TextButton.MouseButton1Click:Connect(function()
	print(player.Team)
	if player.Team == RedTeam then
		player.Team = YellowTeam
	end
	if player.Team == YellowTeam then
		player.Team = RedTeam
	end
	--print(player.Team)
end)


Line 8 isn't being read. I start off as YellowTeam, I switch to RedTeam just fine. From RedTeam to YellowTeam it doesn't work. Why?

1 answer

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