-- Created by Corno_1

local addX = 0
local addY = 0
local addZ = 0
local onetimeEvent = 0

function snowbox_followplr_init(e)

end

function snowbox_followplr_main(e)

  if onetimeEvent == 0 then
    addX = g_Entity[e]['x'] - g_PlayerPosX
    addY = g_Entity[e]['y'] - g_PlayerPosY
    addZ = g_Entity[e]['z'] - g_PlayerPosZ
  end

  SetPosition(e,g_PlayerPosX+addX,g_PlayerPosY+addY,g_PlayerPosZ+addZ)
  ResetPosition(e,g_PlayerPosX+addX,g_PlayerPosY+addY,g_PlayerPosZ+addZ)
  
  onetimeEvent = 1
  
end