-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- Player Collects Health function collect_wood_init(e) end function collect_wood_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist < 100 and g_PlayerHealth > 0 then Prompt("Press E to pick this up.") if g_KeyPressE == 1 then PlaySound(e,0) g_woodcollected = g_woodcollected + 1 Destroy(e) ActivateIfUsed(e) end end end