-- DESCRIPTION: Attach particle to something local U = require "scriptbank\\utillib" local Q = require "scriptbank\\quatlib" local particles = {} function attach_particle_to_player_properties( e ) end function attach_particle_to_player_init_name( e ) particles[ e ] = { state = 'init' } end local function getEntityLinks( e ) local list = {} for i = 0, 9 do local elink = GetEntityRelationshipID( e, i ) if elink > 0 then list[ #list + 1 ] = elink end end return list end function attach_particle_to_player_main( e ) local ge = particles[ e ] if ge == nil then return end if ge.state == 'init' then ge.links = getEntityLinks( e ) if #ge.links == 0 then ge.state = 'unlinked' return end ge.state = 'ready' elseif ge.state == 'ready' then local ppx, ppy, ppz = g_PlayerPosX, g_PlayerPosY + 73, g_PlayerPosZ for _, p in pairs( ge.links ) do local obj = g_Entity[ p ].obj PositionObject( obj, ppx, ppy, ppz ) end elseif ge.state == 'unlinked' then PromptLocal( e, 'Not linked to anything' ) end end