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

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

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

✓ Accepted answer

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.

2 comments

0

Accpet answer if this helps!

0

You can put the value of a property in a variable, but not a referance to the property itself.

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