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

How to use PlayerGui to display Gui only for once player?

Asked by 3 years ago

I made a cooldown system where if the player presses a button a cooldown gui appears. But it appears for every player ingame. I heard of PlayerGui and Think that could make it so the gui would work for all players but also on be visible to the player that connects the function. If theres a easier or better solution please let me know.

Heres my code:

local remote = game.ReplicatedStorage.TheWorld.BaconTimeStop

remote.OnServerEvent:Connect(function()
    script.Parent.Ts.TextLabel.Visible = true
    script.Parent.Ts.Visible = true
    wait(60)
    script.Parent.Ts.Visible = false
    script.Parent.Ts.Frame.Visible = false

end)

1 answer

Log in to vote
0
Answered by 3 years ago

Use a local script

0
When I use the local script it says I cant use server event in a local script. But when I change it to a client event the cooldowns dont work. azaabbie 0 — 3y
Ad

Answer this question