Announcement

Collapse
No announcement yet.

OnPlayerSpawn client side doesn't return player

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    OnPlayerSpawn client side doesn't return player

    Hello,

    On client side :
    Code:
    function OnPlayerSpawn(player)
      AddPlayerChat("player: " .. player)
    end
    AddEvent("OnPlayerSpawn", OnPlayerSpawn)
    Code:
    attempt to concatenate a nil value (local 'player')


    This workaround works:
    Code:
    function OnPlayerSpawn()
      AddPlayerChat("player: " .. GetPlayerId())
    end
    AddEvent("OnPlayerSpawn", OnPlayerSpawn)

    #2
    Client side events don't return the player as you can just get it using GetPlayerId()

    Comment


      #3
      There is no spawning event on the client for remote players. So yes it's on purpose.

      Comment

      Working...
      X