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

Why does the script I used only work in studio but not in-game? Any parts missing from the script?

This question is to my previous question:

https://scriptinghelpers.org/questions/52374/my-screengui-images-dont-work-when-i-press-a-button-help-please

I have encountered another failure of Boots script because it doesn't do the countdown

Heres the code...

game.Players.PlayerAdded:connect(function(plr)
function onClicked()
    wait(0.5)
    plr.PlayerGui.CountDownNo.Three.ImageTransparency = 0 -- Number Three Appears
    script.Parent.Sound:Play()
    wait(1)
    plr.PlayerGui.CountDownNo.Three.ImageTransparency = 1 -- Number Three Disappears
    plr.PlayerGui.CountDownNo.Two.ImageTransparency = 0 -- Number Two Appears
    wait(1)
    plr.PlayerGui.CountDownNo.Two.ImageTransparency = 1 -- Number Two Dissapears
    plr.PlayerGui.CountDownNo.One.ImageTransparency = 0 -- Number One Appear
    wait(1)
    plr.PlayerGui.CountDownNo.One.ImageTransparency = 1 -- Number One Disappears
end
end)
script.Parent.ClickDetector.MouseClick:connect(function()
    onClicked()
end)

iddash wanted to help me but it didn't work as well... Any help? Also, I'm looking for an easy/beginner way so I can remember it.

2 answers

✓ Accepted answer

Guis can only be edited through a local script to work in-game. Something like this in a local script inside StarterGui could work instead:

local plr = game.Players.LocalPlayer
workspace["PartNameHere"].ClickDetector.MouseClick:Connect(function(hit)
	if hit == plr then
		--gui appearing and disappearing here
	end
end)

Click workspace search "FilteringEnabled" in properties and click box save game

1 comment

0

I'm not trying to put on Filtering Enabled... -_-

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