I want a remoteEvent to pass the player who has just been joined through to the server side (playerAdded will be changed later I'm just using it as an example) and it will send the player through who has just joined and it will print their name off in the script (This will also be changed). However, I'm not sure if I've set up the scripts wrong.
Local script:
local remoteEventPlayer = game.ReplicatedStorage.robloxLocalPhoto
game.Players.PlayerAdded:Connect(function(player)
remoteEventPlayer:FireServer(player)
end)
remoteEventPlayer:FireServer(player)
Server script:
local remoteEventLocalPhoto = game.ReplicatedStorage.robloxLocalPhoto
local function playerPhoto(player)
local playerName = player.Name
print(playerName)
end
remoteEventLocalPhoto.OnServerEvent(playerPhoto)
Whenever I test, it just says this:
' 15:38:07.221 - ServerScriptService.userPhoto:3: attempt to call field 'OnServerEvent' (a userdata value)'
Why?
