How would I get the player here

I’m using a Server script in the workspace
I need to player so I can add the Coins and Exp to their leaderstats

local CoinValue = script.Parent.Parent.Parent.Parent.Parent.Coins
local ExpValues = script.Parent.Parent.Parent.Parent.Parent.Exp

script.Parent.MouseButton1Click:Connect(function(click)
	
end)

I don’t know what the argument “click” means, but that is where the player who clicked the clickdetector is given.
Or if you’re using gui then use a local script and remote events, as @IFthenElse246 said

1 Like

use a local script and remote events

1 Like

I know that but it gives me an error when i try to get the player from there

“.MouseClick” is the event for ClickDetector instances, in this case “.MouseButton1Click” is being used, which is the event for GuiButton objects, this event doesn’t have any parameters (so click would point to nil).