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

Why doesn't this work?

Asked by 10 years ago

Simple and small.

while true do
    wait(3) 
    if script.Parent.Parent.Time.MapVoting.Done == true then -- I removed this and the script worked fine...

        script.Parent.ImageOne.Bool.Value = 0
        script.Parent.ImageTwo.Bool.Value = 0
    end
end

I've tried re-writing it. It DOES NOT WORK. script.parent.Parent.Time.MapVoting.Done will equal true at one point for 5 seconds, therefore this should run.



while script.Parent.Parent.Time.MapVoting.Done == true do script.Parent.One.Test.Value = 0 script.Parent.Two.Test.Value = 0 end

Also tried that.

1 answer

Log in to vote
0
Answered by
Merely 2122 Moderation Voter Community Moderator
10 years ago

What type of object is "Done"?

script.Parent.Parent.Time.MapVoting.Done

Since it's not a property, it must be an object. And if you're checking if an object is equal to true, that's going to return false every time.

If Done is an IntValue object, you need to use the Value property.

while script.Parent.Parent.Time.MapVoting.Done.Value == true do
0
Done is a BoolValue. I'll tinker around since I have an early start to code. legoguy939 418 — 10y
1
OH WOW. That small mistake? I guess I was so tired I didn't even notice it. Anyway, thanks. Yes, it works now. legoguy939 418 — 10y
Ad

Answer this question