I wanted a remote event to fire only if I myself clicked it. In the MouseButton1Click event, how do I get the name of the player?
You have to use a local script for gui stuff(in your example button clicking).
in local script just define LocalPlayer
and on MouseButton1Click
event just check if local player's name is the same as your username.
Then just fire a remote to server. If you want more security you can fire a remote every time a player clicks a button and then check on server if player's name is your username, but that's less effective.
--Make this a LocalScript inside of the button script.Parent.MouseButton1Click:Connect(function() local player = game.Players.LocalPlayer if player.Name == "" then -- put ur name in quotes game.ReplicatedStorage.RemoteEvent:FireServer() end)