-- LUA Script - precede every function and global member with lowercase name of script + '_main' local U = require "scriptbank\\utillib" newpieceaquired = 0 function fe_collect_init( e ) Include( "utillib.lua" ) end function fe_collect_main( e ) if fe_setPiece == nil then return end local Ent = g_Entity[ e ] if fe_gotPiece( Ent.health ) then Destroy( e ) end RotateY(e,50) if U.PlayerLookingNear( e, 60, 80 ) then PlaySound( e, 0 ) fe_setPiece( Ent.health ) newpieceaquired = 1 Destroy( e ) end end