Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this ignoring the Boolean Value?

Asked by 6 years ago

So I have a Boolean Value (Playing) that is in the player’s character and I can’t seem to figure out why it ignores it even if it’s set to false. Shouldn’t it not teleport the player or am I doing something wrong?

01if map == 1 then   
02game.Lighting.SampleMap:Clone().Parent = game.Workspace  
03status.Value = "ROBLOXIAN FOREST!"   
04wait(5)  
05target = CFrame.new(20.531, -47.377, 53.969)
06for i, player in ipairs(game.Players:GetChildren()) do   
07if player.Character.Playing.Value == true then   
08player.Character.UpperTorso.CFrame = target + Vector3.new(0, i * 0, 0)  
09player.Character.IsAlive.Value = true
10 
11end
12 
13end
14 
15end

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Did you confirm that the boolean is being changed by the server side?
If the boolean is not being changed by the server side, try setting up remote events and remote functions.
That should be the main cause of this problem, but if that doesn’t resolve it, try this:

01if map == 1 then
02 game.Lighting.SampleMap:Clone().Parent = game.Workspace  
03 status.Value = "ROBLOXIAN FOREST!"   
04 wait(5)  
05 target = CFrame.new(20.531, -47.377, 53.969)
06 for i, player in ipairs(game.Players:GetChildren()) do   
07 print("Okay, it's set to ".. tostring(player.Character.Playing.Value).. " on the server side.")
08 if player.Character:FindFirstChild("Playing").Value == false then  
09 print("This player is being ignored..")
10 else
11 player.Character.UpperTorso.CFrame = target + Vector3.new(0, i * 0, 0)  
12 player.Character.IsAlive.Value = true
13  
14 end  
15 end
16 end
Ad
Log in to vote
0
Answered by 6 years ago

That’s correct, that will only teleport the player if the value of Playing is equal to true, which means that it’s equal to true; it isn’t ignoring it. Click on the BoolValue in the explorer, and assuming nothing altered it since then, it should be set to true. You can also do

1print(Playing.Value)

which should print out true.

Answer this question