-- LUA Script - precede every function and global member with lowercase name of script + '_main' g_camp_fire=0 entity_number1 = 12 -- entitiy number 1 that you would like to spawn e.g the fire entity_number2 = 14 -- second entity e.g the flame decal function place_fire_init(e) end function place_fire_main(e) PlayerDX = g_Entity[e]['x'] - g_PlayerPosX; PlayerDY = g_Entity[e]['y'] - g_PlayerPosY; PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ; PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ)); if PlayerDist < 420 and g_camp_fire == 1 then Text(35,85,1,"This Looks Like a good place to make camp Press E to Place a Fire.") --adjust the first figure to line up the text if g_KeyPressE == 1 then PlaySound(e,1) Spawn(entity_number1) Spawn(entity_number2) end end end