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

Why Doesn't my i,v string work properly?

Asked by 3 years ago
Edited 3 years ago

So for context I am making a Gui that has player mods that is supposed to fade in and out, but the textButtons' background is transparent

1local plrMods = script.Parent.Parent.Parent.Frame.PlayerMods
2 
3script.Parent.MouseButton1Click:Connect(function()
4for i = 1,100,1 do
5plrMods.Jump.TextTransparency = plrMods.Jump.TextTransparency - 1
6   end
7end)

3 answers

Log in to vote
0
Answered by 3 years ago

On line 5, you made it remove 1 from the transparency, when you should've done 0.1.

Try:

local plrMods = script.Parent.Parent.Parent.Frame.PlayerMods

script.Parent.MouseButton1Click:Connect(function() for i = 1,100,-1 do plrMods.Jump.TextTransparency = plrMods.Jump.TextTransparency - 0.1 end end)

0
hmm It doesn't seem to work, should I use a local script instead? Black_Magic2533 104 — 3y
0
Yes, use a local script. andarwniceguyjr 0 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

for eazy copy from andarwniceguyjr

1local plrMods = script.Parent.Parent.Parent.Frame.PlayerMods
2 
3script.Parent.MouseButton1Click:Connect(function()
4    for i = 1,100,-1 do
5        plrMods.Jump.TextTransparency = plrMods.Jump.TextTransparency - 0.1
6    end
7end)
Log in to vote
0
Answered by 3 years ago

this should work

1local plrMods = script.Parent.Parent.Parent.Frame.PlayerMods
2 
3script.Parent.MouseButton1Click:Connect(function()
4    for i = 1,100,-1 do
5        wait()
6        plrMods.Jump.TextTransparency = plrMods.Jump.TextTransparency - 0.01
7    end
8end)

Answer this question