Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Urgent HELP! Why it don't work?

Asked by 9 years ago

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 ?

3 answers

Log in to vote
0
Answered by
fai1bro 25
9 years ago

Startergui is given when a player spawns, so It should be game.Players.PLAYERNAME.PlayerGui

Ad
Log in to vote
0
Answered by
DataStore 530 Moderation Voter
9 years ago

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

You need to capitalize "textButton." Scripts are case-sensitive.

0
Still don't work :{ ThawedAlex 0 — 9y
0
There's one line of your code where "StarterGui" is repeated, so you'll have to delete one copy. whyOmustOitObeOme 7 — 9y
0
Do you got skype so you can show me where? I don't see it *facepalm*. ThawedAlex 0 — 9y
0
No, sorry. whyOmustOitObeOme 7 — 9y
0
Accept party on ROBLOX so we can talk then ? ThawedAlex 0 — 9y

Answer this question