Ad
Log in to vote
0

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

Asked by 2 months ago
Edited 2 months 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

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 - 1
   end
end)

3 answers

Log in to vote
0
Answered by 2 months 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 24 — 2mo
0
Yes, use a local script. andarwniceguyjr 0 — 2mo
Ad
Log in to vote
0
Answered by 2 months ago

for eazy copy from andarwniceguyjr

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)
Log in to vote
0
Answered by 2 months ago

this should work

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

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

Answer this question