function Click()
game.StarterGui.ScreenGui.A.Frame.MessageWIP.Visible = true
wait(2)
game.StarterGui.ScreenGui.A.Frame.MessageWIP.Visible = false
end
script.Parent.ClickDetector.MouseClick:connect(Click)
****this is with a part, not a gui.
function Click()
game.StarterGui.ScreenGui.A.Frame.MessageWIP.Visible = true
wait(2)
game.StarterGui.ScreenGui.A.Frame.MessageWIP.Visible = false
end
script.Parent.ClickDetector.MouseClick:connect(Click)
****this is with a part, not a gui.
Classic error. Modifying the StarterGui will modify it for new or respawning players. In your case, you'd want to edit PlayerGui.
Simple edits, such as;
debounce = false --Add a debounce so it doesn't get spammed.
script.Parent.ClickDetector.MouseClick:connect(function(player) --An easier way to connect, also defines the player who clicked it.
if debounce == false then --Check if the debounce is "false"
debounce = true --Enable the Debounce
player.PlayerGui.ScreenGui.A.Frame.MessageWIP.Visible = true
wait(2)
player.PlayerGui.ScreenGui.A.Frame.MessageWIP.Visible = false
debounce = false --Disable the Debounce
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
6 comments
you have to do a function
This looks like it would work. Great answer!
@bossay, This answer has a function, "connect(function(player) ".
but it didnt work
Please remember this won't work with FilteringEnabled as it modifies assets. To use FE with it, you'd have to incorporate RemoteEvents.
thanks