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 2 years ago
Edited 2 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

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