Hey, beginner scripter trying to create a GUI that pops up when the player clicks something. If I click it in-game it appears on everyone's screen however I only want it to appear on the player who clicked its screen.
I believe this is because I am accessing the player wrong?
Any help is appreciated.
local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
local ShiftEvent = game.ReplicatedStorage:WaitForChild("ShiftEvent")
local JobGui = game.Workspace.JobGui.SurfaceGui:WaitForChild("JobButton")
local EndShift = game.StarterGui:WaitForChild("EndShift")
local Players = game:GetService("Players")
Players.PlayerAdded : connect(function(player)
JobGui.MouseButton1Click:Connect(function(Pressed)
ShiftEvent:FireClient(player, EndShift)
end)
end)

2 comments
oh no- oh no- sorry, I've edited
please accept an answer