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

another gui problem?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
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.

1 answer

Log in to vote
2
Answered by 8 years ago

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)
0
you have to do a function bossay123 45 — 8y
1
This looks like it would work. Great answer! User#11440 120 — 8y
1
@bossay, This answer has a function, "connect(function(player) ". 262187 45 — 8y
0
but it didnt work bossay123 45 — 8y
View all comments (2 more)
0
Please remember this won't work with FilteringEnabled as it modifies assets. To use FE with it, you'd have to incorporate RemoteEvents. TheHospitalDev 1134 — 8y
0
thanks bossay123 45 — 7y
Ad

Answer this question