I am trying to make a script so that when the value (parent of the Script), is true, a block of code fires. For some reason, when the value is true (I checked this by the way), the code does not fire. Also, the script is not in server storage, or any other place where a script won't run.
Here is my code:
if script.Parent.Value == true then print("Success") script.Parent.Parent.Parent = workspace script.Parent.Parent.Position = Vector3.new(-70.844, 45.947, -233.831) script.Parent.Parent.Position = Vector3.new(-0.28, 0.01, -2.68) workspace.tele1.Position = Vector3.new(-75.923, 37.99, -223.249) workspace.tele2.Position = Vector3.new(1368, -74.568, -53.679) end
you can try
repeat wait() until script.Parent.Value == true print("Success") script.Parent.Parent.Parent = workspace script.Parent.Parent.Position = Vector3.new(-70.844, 45.947, -233.831) script.Parent.Parent.Position = Vector3.new(-0.28, 0.01, -2.68) workspace.tele1.Position = Vector3.new(-75.923, 37.99, -223.249) workspace.tele2.Position = Vector3.new(1368, -74.568, -53.679)
[REMEMBER TO MARK ME AS THE CORRECT ANSWER IF I HELPED TO FIX YOUR CODE, THANKS!]
-- Explanation --
Your if-statement will fire when the game runs. But not forever, it only fire once when game starts.
So if you want to fix this, a little lazy answer is loop the if-statement and fire it every 1 second.
while wait(1) do -- Your entire code end
Note: The code will work, but it's not the best answer. You can try to research for more answer. Thanks for reading, and I hope this helped too! Best of the luck, bye!