I know how to find out the name of the player who clicked a brick using a click detector, but what if I want to find out who clicked a gui? Please answer with some help!
You can't find out who pressed a gui since that gui is only in the players gui. This code basically shows how to use this.
local target = game.Players.LocalPlayer local owner = "Spooksletsky" script.Parent.MouseButton1Down:connect(function() if target and target.leaderstats.Money.Value >= 100 and target.Name == owner then target.leaderstats.Money.Value = target.leaderstats.Money.Value-100 end end)