I'm messing around with RemoteEvents at the moment, trying to get a better understanding of how it works. But I don't exactly understand why button is returning nil?
Local Script
local button = script.Parent
button.MouseButton1Click:Connect(function()
print(button)
game:GetService("ReplicatedStorage").TestEvent:FireServer(button)
end)
Server
local repStorage = game:GetService("ReplicatedStorage")
local event = repStorage:WaitForChild("TestEvent")
event.OnServerEvent:Connect(function(player, button)
print(player, button)
end)
The output is Player1 nil

1 comment
just do 'button.Name' as the argument