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

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 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

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 3 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