Nothing happening, even though it's true

The team GUI should show when the battle starts, the player is on spectator and hasn’t opened it yet. When the function is called, it prints Stage “Battle”, open = false, and player’s team “Spectator”. However, when it checks it in the if statement, nothing happens even though everything in it is true…

local open = false

roundfolder.Stage.Changed:Connect(function()
	print(roundfolder.Stage.Value)
	print(open)
	print(player.Team)
	if roundfolder.Stage.Value == "Battle" and open == false and player.Team == "Spectator" then
		open = true
		print("opening")
		frame.Frame2.Shop:TweenPosition(UDim2.new(0.232, 0, 0.085, 0),"Out","Quad",.25)
		print("opened")
	end
end)
1 Like

What I normally do in this scenario is check if every condition evaluates to true and go from there. Like so.

print(roundfolder.Stage.Value == "Battle")
print(open)
print(player.Team == "Spectator")

Each print statement should print out a bool. Sometimes it does pay off to see for yourself if each element is true. Then if something evaluates to false, find out why it evaluates to false.

1 Like

player.Team in a object not a string use .Name

2 Likes

Yeah that was the issue, I just need to solve it now. Thank you.

1 Like

Yup, that’s what fixed my second problem. Thanks.

1 Like