Well, basically, I've got a portion of a script that isn't working, when from all I can see, should be. Here's the portion in question --
local hant1 = script.Parent.haunt1.ImageTransparency local hant2 = script.Parent.haunt2.ImageTransparency local hant1b = script.Parent.haunt1.BackgroundTransparency local hant2b = script.Parent.haunt2.BackgroundTransparency local red = script.Parent.red for i = 1,10 do hant1 = hant1 + .1 hant1b = hant1b + .2 wait(.1) end wait(1) for i = 1,10 do hant2b = hant2b - .2 hant2 = hant2 - .1 wait(.1) end wait(2.5) for i = 1,10 do hant2 = hant2 + .1 hant2b = hant2b + .2 wait(.1) end for i = 1, 3 do red.BackgroundTransparency = red.BackgroundTransparency + .3 wait() end for i = 1, 3 do red.BackgroundTransparency = red.BackgroundTransparency - .3 wait(.01) end
This is in a local script, and all of it does run (guaranteed with a
Thank you for reading, and I hope to find a solution to this strange issue.
It looks like your loops on 29-37 should be working, but the other three wouldn't work.
This is because when you declare your hant variables at the beginning, you're actually just declaring numbers, with values of whatever the Image/Background transparency of the objects happen to be when those lines run. When you change the values of those variables, you're not actually changing the property, just the value of the variable within the script. Instead, when you want to change the property, you need to start at the instance that owns the property. So for you,
hant1 = script.Parent.hant1 and then
hant1.ImageTransparency = hant1.ImageTransparency + 0.1
Hope this helps!