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

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

Asked by 6 years ago

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

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

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)
Ad
Log in to vote
0
Answered by 6 years ago

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

0
I'm not trying to put on Filtering Enabled... -_- AwesomeGamer2223 105 — 6y

Answer this question