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

Player's value is false, but it still goes through an if statement?

for i, plr in pairs(game.Players:GetPlayers()) do
	                print('in the for!')
	                if plr.IsRacing.Value == true then
	                    local jeep = 1
	                    plr.Character.HumanoidRootPart.CFrame = jeeps[jeep].CFrame
	                    jeep += 1	  
			end
		end

So, I'm making a racing game and if a player's value is true, they get placed into the race. However, they still get teleported regardless of the value. Why?

2 comments

0

This is most likely because the players value is false only on the clients side.

0

it worked. thanks!

1 answer

Line 1 grabs all players then does whatever te rest of the code wants, the trouble is that this code will only detect what your IsRacing value says once, nto repeatedly, you need a script tat activates upon Value Changed.

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