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

How do I make a Value degrade by i.e 1?

Asked by
RSoMKC 45
10 years ago

Sounds like a stupid question, but I have no idea how to make it work.

plankValue = script.Parent.pValue

if plankValue.Value == 0 then
    script.Parent.B.CanCollide = false
else
    wait(math.random(3,5))
    plankValue.Value -1 -- PoA;  How do I make it degrade 1 every 3-5 seconds.
end

if plankValue.Value == 4 then
    script.Parent.p4.Anchored = false
end

if plankValue.Value == 3 then
    script.Parent.p3.Anchored = false
end

if plankValue.Value == 2 then
    script.Parent.p2.Anchored = false
end

if plankValue.Value == 1 then
    script.Parent.p1.Anchored = false
end

Answer this question