Jump to content

Raxe88

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Raxe88

  1. This is my code:

     

    DeathTrigger.lua (attached to a box)

    Script.respawnPoint = "" --Entity "respawn point"
    function Script:Collision(entity, position, normal, speed)
    if(entity:GetKeyValue("name") == "Player") then
    spawnPos = self.respawnPoint:GetPosition()
    --entity:SetPosition(spawnPos)
    entity:Respawn(spawnPos)
    end
    end
    

     

    and

     

    FPSPlayer.lua (attached to the player)

    function Script:Respawn(spawnPos)
    self.entity:SetPosition(spawnPos)
    end
    

     

    When they collision I get this error:

     

    3606c60f7a.png

     

    I have a Pivot indicating the respawn point:

    10a875d5f0.png

     

    Line 65 is this from DeathTrigger.lua:

     

    entity:Respawn(spawnPos)

     

    From my point of view it should work. Any help?

     

    Edit: I just found it out. Turns out that this works:

    entity.script:Respawn(spawnPos)
    

     

    A little explanation would be welcome tongue.png

×
×
  • Create New...