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

Why will this loop not check this value? (server script)

local path = script.Parent.SaveObject.Value

while true do
if script.Parent.WreckTree.Value == "true" then
	print("comon")
	path:Destroy()
end
wait(0.1)
end

If value is true it prints comon and destroys the path (saveobject = game.Workspace.Tree) and wont work and wont print, why not?

4 comments

0

is WreckTree a BoolValue?

1

in true get rid of the speech marks, if its a bool value

1

Also, I think when you destroy the object, you need to have the path variable equal to the object not the value (I have not tested anything).

0

If SaveObject is a value type, then that's true

1 answer

✓ Accepted answer

in true get rid of the speech marks, if its a bool value, your code will look like this

local path = script.Parent.SaveObject.Value

while true do
if script.Parent.WreckTree.Value == true then
    print("comon")
    path:Destroy()
end
wait(0.1)
end

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