✓ Accepted answer
I have a couple of suggestions:
0.5: Try using less exact numbers. the last 3 digits make an unseeable difference.You can see it but it is repeat really= really + 1 until really = math.huge unnecessary and hard to see.
Coding methods:
You can use "Ctrl + H" to use the "replace tool for replacing Granny with whatever you want the variable to be called
1: Organize the script. Just do a repeat/for loop. Ex:
local Granny = script.Parent.Parent
function onMouseButton1Click()
for i,v in pairs(Granny:GetChildren()) do
if v:IsA('TextButton') then
for i = 0, 1, .1 do
v.BackgroundTransparency = i
v.TextTransparency = i
Granny.TextLabel.TextTransparency = 1
wait(.03)
end
end
end
end
script.Parent.MouseButton1
Click:connect(onMouseButton1Click)
2: Courtine: This might work if the one above doesn't or if you prefer to use this.
local Granny = script.Parent.Parent
local BackgroundTransparency = coroutine.wrap(function()
for i,v in pairs(Granny:GetChildren()) do
if v:IsA('TextButton') then
for i = 0, 1, .1 do
v.BackgroundTransparency = i
wait(.03)
end
end
end
end)
local TextTransparency1 = coroutine.wrap(function()
for i,v in pairs(Granny:GetChildren()) do
if v:IsA('TextButton') then
for i = 0, 1, .1 do
v.TextTransparency = i
wait(.03)
end
end
end
end)
local TextTransparency2 = coroutine.wrap(function()
for i,v in pairs(Granny:GetChildren()) do
if v:IsA('TextButton') then
for i = 0, 1, .1 do
Granny.TextLabel.TextTransparency = 1
wait(.03)
end
end
end
end)
BackgroundTransparency()
TextTransparency1()
TextTransparency2()
If you need help, comment.
If this helped, please accept this :D
1 comment
Overall, the script may seem instantaneous because it only takes 0.3 seconds to do the loop.