So guys i have a ScreenGui.TextButton and it seems to don't work i do that thing .. WHY? "StarterGui.textButton.MouseButton1Down:connect(function() print(("I try i try")) game.StarterGui.textButton.BackgroundTransparency = 0 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.1 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.2 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.3 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.4 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.5 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.6 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.7 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.8 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 0.9 wait(0.2) game.StarterGui.textButton.BackgroundTransparency = 1 wait(0.2) game.StarterGui.textButton.TextTransparency = 0 wait(0.2) game.StarterGui.StarterGui.textButton.TextTransparency = 0.1 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.2 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.3 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.4 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.5 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.6 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.7 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.8 wait(0.2) game.StarterGui.textButton.TextTransparency = 0.9 wait(0.2) game.StarterGui.textButton.TextTransparency = 1 wait(0.3)
end)" But it dosn't work help ?
Startergui is given when a player spawns, so It should be game.Players.PLAYERNAME.PlayerGui
Firstly, as pointed out by fai1bro you need to change the GUI that's in the player's PlayerGui, not the one which is in the StarterGui service.
Secondly, how you're changing the transparency of the button is incredibly long winded, decreases readability and is a waste of time. You can achieve the same effect by use of a for loop.
Below is my suggestion of how this code could be improved by the use of a for loop. For it to work it would need to be placed inside of the TextButton.
script.Parent.MouseButton1Down:connect(function() for Transparency = 0, 1, 0.1 do wait(0.2) script.Parent.BackgroundTransparency = Transparency script.Parent.TextTransparency = Transparency end end)
You need to capitalize "textButton." Scripts are case-sensitive.