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

Why isnt this function script not working?

Asked by
TrollD3 105
9 years ago

I made a loading frame that would grow until it hits a specific position. The growing thing is working. But the function load() isnt working at all. The output doesn't say anything. Can someone help me fix this?

lol = 1
for i = 0,89.7 do
script.Parent.Scroll.Size = UDim2.new(0, i*10, 0, 65)
wait(math.random(0.08,0.54))
end
function Load()
if script.Parent.Scroll.Size == UDim2.new(0, 897, 0, 65) then
lol = script.Parent.Scroll.BackgroundTransparency + .1
lol = script.Parent.BackScroll.BackgroundTransparency + .1
script.Parent.Scroll:Destroy()
script.Parent.BackScroll:Destroy()
wait(.4)
lol = script.Parent.Mystic.ImageTransparency + .1
script.Parent.Mystic:Destroy()
end
end
Load()
0
With your 'lol' variables -- Are you trying to change the transparency of the guis? Perci1 4988 — 9y
0
yes TrollD3 105 — 9y

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago
lol = script.Parent.Scroll.BackgroundTransparency + .1

This makes lol equal to the BackgroundTransparency, plus 0.1. lol is a number. It does not, in any way, tell the computer to change the gui's transparency. Remember, computers only do what you specifically tell them to do.

We just need to edit it like any other variable. We can make the gui's transparency equal the gui's transparency, plus 0.1:

script.Parent.Scroll.BackgroundTransparency = (script.Parent.Scroll.BackgroundTransparency + 0.1)
--Parentheses were added for clarity. Don't use them.

Or, if you would like:

lol = script.Parent.Scroll.BackgroundTransparency + .1
script.Parent.Scroll.BackgroundTransparency = lol

will do the same thing. Although I would recommend the first method.

0
ty TrollD3 105 — 9y
Ad

Answer this question