script.Parent.OnServerEvent:Connect(function(player)
local spoon = game.ReplicatedStorage.EraserMaking.Spoon:Clone()
if spoon.Parent ~= player then
spoon.Parent = player.Backpack
end
end)
There is the script, how does it know which player clicked it? It works, I just dont understand how the 'player' function variable is returned to it, and/or how it knows who the player is. It is also obviously connected to a remote event.
Edit: Here is the other half of the remote event if you guys need to see it.
local givercd = game.Workspace.House.Countertop["Spoon Drawer"].ClickDetector
givercd.MouseClick:Connect(function()
givercd.Parent.RemoteEvent:FireServer()
end)

3 comments
a remote event has 2 halves, wheres the other half?
bcuz it has player in there so its getting the player that presses it
The first argument fed to a RemoteEvent is always the player who fired it.