But I don’t want to do it. Because I am lazy and exploiters can fire it too. This part exploiters can fire too, so I don’t like to use remoteevent.
it’s difficult to get the player clicking it on a SurfaceGui though, the error from @Sallypulman says Player isn’t a valid member of the class MouseButton1Click you could use Players.LocalPlayer best fits for the client but for server-scripts, it’s not possible to use it though, and RemoteEvents will always be fired by exploiters regardless of how much security you put in as they can figure out how it works and grab every information about it, and RemoteFunctions is for returning content of an item when <RemoteFunctionInstance>:InvokeClient() or <RemoteFunctionInstance>:InvokeServer() after adding some function to it.
probably roblox didn’t add that to luau C++ for now,
SurfaceUI currently can’t get the player who pressed a button, as well as it’s not a LocalScript, and there are alternatives by using ClickDetectors or ProximityPrompts as they have an player thing you can insert when interacted event.