✓ Accepted answer
PlayerGui
When a player joins the game, all of the contents inside StarterGui are locally cloned into that player's PlayerGui, so if you want to mess around with the guis of a specific player, it would be best to run your code on a localscript, as MouseClick replicates and the first parameter of MouseClick is the player who clicked.
So, you can match the player who clicked with the localPlayer to see if the localplayer is the one who clicked the button.
local Part =
local Player = game.Players.LocalPlayer
Part.ClickDetector.MouseClick:Connect(function(plr)
if plr == Player then
script.Parent.Visible = true
end
end)
Hopefully this helped!
2 comments
Thank you i'll try this out!
Thank you so much it works!