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

How do I add .1 to the transparency value until it reaches 1?, the rest is in description

Asked by 8 years ago
testVariable = script.Parent.Transparency
if testVariable < 1 then
    testVariable = testVariable + .1
end

\ I want it to add .1 to the transparency value until it reaches 1, I also have a need for when it's OVER 1 but if this script works then I can just reverse it. It'd be best to message me on roblox. (not sure if that's already how this works)

Thanks

1 answer

Log in to vote
-2
Answered by 8 years ago
Edited 8 years ago

Do this

local Part = script.Parent --last time I tried, you cannot put properties in variubles.
while Part.Transparency > 1 then
    Part.Transparency = + .1
    wait(1) -- replace 1 with how long u want to wait before adding more transparency.
end

What this does, is it keeps checking if the part is NOT fully transparent. Then, it adds a bit of transparency, and wait for the amount of time you enter.

0
Accpet answer if this helps! SH_Helper 61 — 8y
0
You can put the value of a property in a variable, but not a referance to the property itself. GoldenPhysics 474 — 8y
Ad

Answer this question