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

My ScreenGUI images don't work when I press a button. Help please?!

I have made a game and there are buttons when you press it there's a sound and there's a countdown as well. If I press the button in testing mode nothing happens only the sound plays. Here's the code:

function onClicked()
	wait(0.5)
	game.StarterGui.CountDownNo.Three.ImageTransparency = 0 -- Number Three Appears
	script.Parent.Sound:Play()
	wait(1)
	game.StarterGui.CountDownNo.Three.ImageTransparency = 1 -- Number Three Disappears
	game.StarterGui.CountDownNo.Two.ImageTransparency = 0 -- Number Two Appears
	wait(1)
	game.StarterGui.CountDownNo.Two.ImageTransparency = 1 -- Number Two Dissapears
	game.StarterGui.CountDownNo.One.ImageTransparency = 0 -- Number One Appear
	wait(1)
	game.StarterGui.CountDownNo.One.ImageTransparency = 1 -- Number One Disappears
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Please help! I'm new to scripting.

1 answer

I changed

    game.StarterGui.CountDownNo.Three.ImageTransparency = 0 -- Number Three Appears

to

    game.Player.LocalPlayer.PlayerGui.CountDownNo.Three.ImageTransparency = 0 -- Number Three Appears

I modified StarterGui, Which is what gets copied over to a player's PlayerGui so nothing was updated.

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