Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

2 comments

0

hmm It doesn't seem to work, should I use a local script instead?

0

Yes, use a local script.

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)

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.