-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- the script will produce 10 ammo so change the lines41-45 to corispond with the amount of resouces you need to craft 10 g_woodcollected=0 g_flintcollected=0 g_camp_fire=0 function fire_crafting_init(e) --Include ("survival\\deployable_fire.lua") end function fire_crafting_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 g_Entity[e]['plrinzone']==1 and g_woodcollected >=1 and g_flintcollected >=1 then Text(34,62,1," Press E to craft a camp fire ") Text(27,65,1,"No of Wood Items = " .. g_woodcollected .. " No of flint shards = " .. g_flintcollected) if g_KeyPressE == 1 and pressed == 0 then pressed = 1 PlaySound(e,1) if g_woodcollected > 0 and g_flintcollected > 0 then g_woodcollected = g_woodcollected - 1 g_flintcollected = g_flintcollected - 1 Prompt " You Crafted a camp fire" g_camp_fire = g_camp_fire + 1 --SwitchScript ( e,"deployable_fire" ) else Prompt "You do not have enough to craft a Fire" end --end of recipe check end --end of input check end --end of distance check if g_KeyPressE == 0 then pressed = 0 end -- reset input end -- end of main