-- spawnable items shelter etc --entity_number1 = 45 --shelter --entity_number2 = 30 --workbench --entity_number3 = 30 --stove -- globals -- change the values in this list to match the entity Ids on your map g_makeAbleEntities = {['Axe'] = 7, ['Hammer'] = 13, ['Dagger'] = 0, ['Bow'] = 0, ['Pistol'] = 0, ['Rifle'] = 0, ['pAmmo'] = 0, ['rAmmo'] = 0 } g_exp = 0 g_featherscollected = 0 g_watercollected = 0 g_berry_pie = 0 g_berry_soup = 0 g_meatcollected = 0 g_hidecollected = 0 g_meat_pie = 0 g_meat_soup = 0 g_shelter = 0 g_workbench = 0 g_cooker = 0 g_furnace = 0 g_lathe = 0 g_bandages = 0 g_medipack = 0 g_antidote = 0 g_booster = 0 g_resin = 0 local tSize = 2 -- Buttons Arrays local MainButtons = {} local RecipeButtons = {} local Cursor = nil function survival_inventory_init(e) if GetDeviceWidth() > 1600 then tSize = 1 end if GetDeviceWidth() > 2200 then tSize = 3 end -- Option Buttons as Button 1 - whatever local use = LoadImage( "scriptbank\\ss1\\use.png" ) MainButtons = {['iIron'] = { x = 3, y = 59, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option1.png" )) }, ['iLead'] = { x = 14, y = 59, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option2.png" )) }, ['iCopper'] = { x = 25, y = 59, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option3.png" )) }, ['exit'] = { x = 47, y = 69, w = 6, h = 15, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_ok.png" )) }, ['lathe'] = { x = 70, y = 38, w = 4, h = 2, s = CreateSprite( use ) }, ['furnace'] = { x = 70, y = 50, w = 4, h = 2, s = CreateSprite( use ) }, ['exp'] = { x = 80, y = 3, w = 12, h = 5, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option7.png" )) }, -- Menu icons ['tools'] = { x = 52, y = 18, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option8.png" )) }, ['weapons'] = { x = 52, y = 30, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option9.png" )) }, ['bldgs'] = { x = 52, y = 43, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option10.png" )) }, ['food'] = { x = 52, y = 57, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option11.png" )) }, ['fibers'] = { x = 3, y = 18, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option12.png" )) }, ['water'] = { x = 3, y = 26, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\flask.png" )) }, ['flint'] = { x = 3, y = 34, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option14.png" )) }, ['wood'] = { x = 3, y = 42, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option15.png" )) }, ['meat'] = { x = 14, y = 26, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option16.png" )) }, ['hides'] = { x = 27, y = 26, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\b_option17.png" )) }, ['nails'] = { x = 38, y = 26, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\nails.png" )) }, -- Menu icons end -- Use Buttons ['hammer'] = { x = 70, y = 19, w = 4, h = 2, s = CreateSprite( use ) }, ['axe'] = { x = 92, y = 19, w = 4, h = 2, s = CreateSprite( use ) }, ['dagger'] = { x = 70, y = 29, w = 4, h = 2, s = CreateSprite( use ) }, ['bow'] = { x = 92, y = 29, w = 4, h = 2, s = CreateSprite( use ) }, ['arrow'] = { x = 92, y = 33, w = 4, h = 2, s = CreateSprite( use ) }, ['byPie'] = { x = 70, y = 56, w = 4, h = 2, s = CreateSprite( use ) }, ['bySoup'] = { x = 92, y = 56, w = 4, h = 2, s = CreateSprite( use ) }, ['mtPie'] = { x = 70, y = 60, w = 4, h = 2, s = CreateSprite( use ) }, ['mtSoup'] = { x = 92, y = 60, w = 4, h = 2, s = CreateSprite( use ) }, ['shelter'] = { x = 70, y = 44, w = 4, h = 2, s = CreateSprite( use ) }, ['stove'] = { x = 92, y = 42, w = 4, h = 2, s = CreateSprite( use ) }, ['wkbench'] = { x = 92, y = 46, w = 4, h = 2, s = CreateSprite( use ) }, ['tubers'] = { x = 15, y = 18, w = 3, h = 3, s = CreateSprite( LoadImage( "scriptbank\\ss1\\tubers.png" )) }, ['berries'] = { x = 26, y = 18, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\berries.png" )) }, ['iron'] = { x = 14, y = 34, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\iron.png" )) }, ['copper'] = { x = 26, y = 34, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\copper.png" )) }, ['lead'] = { x = 38, y = 34, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\lead.png" )) }, ['planks'] = { x = 14, y = 42, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\planks.png" )) }, ['logs'] = { x = 26, y = 42, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\logs.png" )) }, ['resin'] = { x = 38, y = 42, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\resin.png" )) }, ['chems'] = { x = 3, y = 50, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\chems.png" )) }, ['chems2'] = { x = 14, y = 50, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\chems2.png" )) }, ['chems3'] = { x = 26, y = 50, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\chems3.png" )) }, ['steel'] = { x = 38, y = 59, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\isteel.png" )) }, ['splate'] = { x = 38, y = 50, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\splate.png" )) }, ['hndgun'] = { x = 57, y = 73, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\pistol.png" )) }, ['lnggun'] = { x = 57, y = 80, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\rifle.png" )) }, ['ammo1'] = { x = 77, y = 73, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\ammo.png" )) }, ['ammo2'] = { x = 77, y = 80, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\ammo.png" )) }, ['pistol'] = { x = 70, y = 74, w = 4, h = 2, s = CreateSprite( use ) }, ['pAmmo'] = { x = 92, y = 74, w = 4, h = 2, s = CreateSprite( use ) }, ['rifle'] = { x = 70, y = 82, w = 4, h = 2, s = CreateSprite( use ) }, ['rAmmo'] = { x = 92, y = 82, w = 4, h = 2, s = CreateSprite( use ) }, ['title'] = { x = 39, y = 0, w = 20, h = 10, s = CreateSprite( LoadImage( "scriptbank\\ss1\\title.png" )) }, ['shrooms'] = { x = 37, y = 18, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\mushroom.png" )) }, ['bandage'] = { x = 5, y = 73, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\dressing.png" )) }, ['medkit'] = { x = 5, y = 80, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\medikit.png" )) }, ['pill1'] = { x = 25, y = 73, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\pill1.png" )) }, ['pill2'] = { x = 25, y = 80, w = 4, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\pill2.png" )) }, ['dressing'] = { x = 18, y = 74, w = 4, h = 2, s = CreateSprite( use ) }, ['mediKit'] = { x = 18, y = 82, w = 4, h = 2, s = CreateSprite( use ) }, ['antidote'] = { x = 37, y = 74, w = 4, h = 2, s = CreateSprite( use ) }, ['booster'] = { x = 37, y = 82, w = 4, h = 2, s = CreateSprite( use ) }, ['recipes'] = { x = 4, y = 3, w = 13, h = 4, s = CreateSprite( LoadImage( "scriptbank\\ss1\\recipies.png" )) } } RecipeButtons = { ['recipes'] = { x = 10, y = 10, w = 80, h = 80, s = CreateSprite( LoadImage( "scriptbank\\ss1\\recipes.png" )) } } -- MouseCursor Cursor = CreateSprite( LoadImage ( "scriptbank\\ss1\\cursor.png" )) SetSpriteSize ( Cursor, 2.5, 2.5 ) SetSpritePosition( Cursor, 200, 200 ) for _, v in pairs( MainButtons ) do SetSpriteSize ( v.s, v.w , v.h ) SetSpritePosition ( v.s, 200, 200 ) end for _, v in pairs( RecipeButtons ) do SetSpriteSize ( v.s, v.w , v.h ) SetSpritePosition ( v.s, 200, 200 ) end end local MouseActive = false local pressed = false local MouseDown = false local function ShowMouseCoords() -- for if you need to know them Prompt ("X :"..g_MouseX.." Y:"..g_MouseY) end local function MainMenuActivated() for _, v in pairs( MainButtons ) do SetSpritePosition ( v.s, v.x, v.y ) end end local function RecipeMenuActivated() for _, v in pairs( RecipeButtons ) do SetSpritePosition ( v.s, v.x, v.y ) end end local currMenu = 'Main' local function HideSprites() if currMenu == 'Main' then for _, v in pairs( MainButtons ) do SetSpritePosition ( v.s, 200, 200 ) end elseif currMenu == 'recipes' then for _, v in pairs( RecipeButtons ) do SetSpritePosition ( v.s, 200, 200 ) end end end local function MouseDeactivated() DeactivateMouse() MouseActive = false SetSpritePosition( Cursor, 200, 200 ) SetPlayerWeapons(1) HideSprites() end local mainMenuText = { [ 'Fibers' ] = { x = 8, y = 20 }, [ 'Tubers' ] = { x = 19, y = 20 }, [ 'Berries' ] = { x = 32, y = 20 }, [ 'Shrooms' ] = { x = 42, y = 20 }, [ 'Wood' ] = { x = 8, y = 44 }, [ 'Flints' ] = { x = 8, y = 36 }, -- Metal Ores [ 'Iron' ] = { x = 19, y = 36 }, [ 'Copper' ] = { x = 32, y = 36 }, [ 'Lead' ] = { x = 43, y = 36 }, -- Chemicals [ 'Sulphur' ] = { x = 8, y = 52 }, ['Saltpeter'] = { x = 19, y = 52 }, [ 'Carbon' ] = { x = 32, y = 52 }, -- Weapons / Tools [ 'Hammers Crafted' ] = { x = 57, y = 20 }, [ "Axes Crafted" ] = { x = 79, y = 20 }, [ 'Daggers Crafted' ] = { x = 57, y = 30 }, [ 'Bows Crafted' ] = { x = 79, y = 30 }, [ 'Arrows Crafted' ] = { x = 79, y = 34 }, [ 'Pistols' ] = { x = 64, y = 75 }, [ 'Rifles' ] = { x = 64, y = 83 }, [ 'Pistol Ammo' ] = { x = 82, y = 75 }, [ 'Rifle Ammo' ] = { x = 82, y = 83 }, -- General Constructables [ 'Planks' ] = { x = 19, y = 44 }, [ 'Logs' ] = { x = 32, y = 44 }, [ 'Nails' ] = { x = 43, y = 28 }, [ 'S Plate' ] = { x = 43, y = 52 }, [ 'Flask' ] = { x = 8, y = 27 }, -- metal ingots [ 'iIngot' ] = { x = 8, y = 61 }, [ 'lIngot' ] = { x = 19, y = 61 }, [ 'cIngot' ] = { x = 30, y = 61 }, [ 'sIngot' ] = { x = 43, y = 61 }, [ 'Water' ] = { x = 8, y = 29 } } local function ShowMainMenu( foraged ) Panel( 0, 0, 100, 88) -- background Panel( 37, 1, 61, 10) -- Top Panel( 1, 13, 49.5, 68) -- left Panel( 49.5, 13, 99, 68) -- right Panel( 55, 69, 99, 86) -- right bottom Panel( 1, 69, 45, 86) -- left bottom Panel( 78, 1, 98, 10) -- survival exp Panel( 1, 1, 21, 10) -- survival exp local function doTextGreen( x, y, name, value ) TextColor( x, y, tSize, name .. " " .. math.floor( value ), 10, 255, 10 ) end local function doTextRed( x, y, name) TextColor( x, y, tSize, name, 200, 10, 10 ) end local function doTextForaged (x, y, name ) local f = foraged[name] if f ~= nil then doTextGreen( x, y, name, f.amount ) else doTextRed( x, y, name ) end end --menu text plants for name, loc in pairs( mainMenuText ) do doTextForaged( loc.x, loc.y, name ) end --menu text experience doTextGreen( 91, 6, '', g_exp ) -- !!! still TODO items !!! doTextGreen( 43, 44, "Resin", g_resin ) -- menu text meat doTextGreen( 19, 28, "Meat", g_meatcollected ) -- menu text Skins doTextGreen( 32, 28, "Hides", g_hidecollected ) --menu text housing doTextGreen( 57, 45, "Shelters Crafted", g_shelter ) doTextGreen( 79, 43, "Stove Crafted", g_cooker ) doTextGreen( 79, 47, "Workbench Crafted", g_workbench ) doTextGreen( 57, 51, "Furnace Crafted", g_furnace ) doTextGreen( 57, 39, "Lathe Crafted", g_lathe ) -- menu text food doTextGreen( 57, 57, "Berry pies crafted", g_berry_pie ) doTextGreen( 79, 57, "Berry soup crafted", g_berry_soup ) doTextGreen( 57, 61, "Meat Pies crafted", g_meat_pie ) doTextGreen( 79, 61, "Meat soup crafted", g_meat_soup ) -- Meds doTextGreen( 10, 75, "Bandages", g_bandages ) doTextGreen( 10, 83, "Medipacks", g_medipack ) doTextGreen( 30, 75, "Antidote", g_antidote ) doTextGreen( 30, 83, "Boosters", g_booster ) end local function ShowRecipesMenu() -- Text stuff for Recipes in here end local function HandleMouseClicks( foraged ) local function changeAmount( name, by ) if foraged[name] == nil then foraged[name] = {amount = 1} else foraged[name].amount = foraged[name].amount + by end end local bt_clicked = 'none' if currMenu == 'Main' then -- Handle Your mouse click events here for k, v in pairs( MainButtons ) do if g_MouseX > v.x and g_MouseX < v.x + v.w and g_MouseY > v.y and g_MouseY < v.y + v.h then bt_clicked = k break end end if bt_clicked == 'none' then return end --PromptDuration( bt_clicked , 2000 ) -- Handle your bt_clicked events here: bt_clicked option chosen if bt_clicked == 'iIron' then -- Button 1 clicked PromptDuration ( "Iron Ingot", 3000 ) elseif bt_clicked == 'iLead' then PromptDuration ( "Lead Ingot", 3000 ) elseif bt_clicked == 'iCopper' then PromptDuration ( "Copper Ingot", 3000 ) elseif bt_clicked == 'exit' then MouseDeactivated() elseif bt_clicked == 'lathe' then PromptDuration ( "Lathe", 3000 ) elseif bt_clicked == 'furnace' then PromptDuration ( "Furnace", 3000 ) elseif bt_clicked == 'exp' then PromptDuration ( "Experience", 3000 ) -- lines below are to tell GG what to actually do when the buttons are pressed e.g copy and paste a section and edit to suit -- use buttons elseif bt_clicked == 'hammer' and (foraged['Wood'].amount >= 2 and foraged['Fibers'].amount >= 2 and foraged['Flints'].amount >= 2) then AddPlayerWeapon(g_makeAbleEntities['Hammer']) changeAmount( 'Wood', -2 ) -- take items from inventory changeAmount( 'Fibers', -2 ) -- take items from inventory changeAmount( 'Flints', -2 ) -- take items from inventory changeAmount( 'Hammers Crafted', 1 ) g_exp = g_exp + 10 -- adds exp N.B you can change this to what you want depending on the complexity of each item PromptDuration ( "You Crafted a Hammer", 3000 ) elseif bt_clicked == 'axe' and (foraged['Wood'].amount >= 2 and foraged['Fibers'].amount >= 2 and foraged['Flints'].amount >= 2) then AddPlayerWeapon(g_makeAbleEntities['Axe']) changeAmount( 'Wood', -2 ) -- take items from inventory changeAmount( 'Fibers', -2 ) -- take items from inventory changeAmount( 'Flints', -2 ) -- take items from inventory changeAmount( 'Axes Crafted', 1 ) g_exp = g_exp + 10 -- adds exp PromptDuration ( "You Crafted an Axe", 3000 ) elseif bt_clicked == 'dagger' and (foraged['Wood'].amount >= 2 and foraged['Fibers'].amount >= 2 and foraged['Flints'].amount >= 2) then AddPlayerWeapon(g_makeAbleEntities['Dagger']) changeAmount( 'Wood', -2 ) -- take items from inventory changeAmount( 'Fibers', -2 ) -- take items from inventory changeAmount( 'Flints', -2 ) -- take items from inventory changeAmount( 'Daggers Crafted', 1 ) g_exp = g_exp + 10 -- adds exp PromptDuration ( "You Crafted a Dagger", 3000 ) elseif bt_clicked == 'bow' and (foraged['Wood'].amount >= 2 and foraged['Fibers'].amount >= 2 and foraged['Flints'].amount >= 2) then AddPlayerWeapon(g_makeAbleEntities['Bow']) -- number of the Bow entity goes here changeAmount( 'Wood', -2 ) -- take items from inventory changeAmount( 'Fibers', -2 ) -- take items from inventory changeAmount( 'Flints', -2 ) -- take items from inventory changeAmount( 'Bows Crafted', 1 ) -- adds crafted item to inventory for exp g_exp = g_exp + 10 -- adds exp PromptDuration ( "You Crafted a Bow", 3000 ) elseif bt_clicked == 'arrow' and (foraged['Wood'].amount >= 2 and foraged['Fibers'].amount >= 2 and foraged['Flints'].amount >= 2) then AddPlayerAmmo(g_makeAbleEntities['Arrow']) -- number of the Arrows entity goes here changeAmount( 'Wood', -2 ) -- take items from inventory changeAmount( 'Fibers', -2 ) -- take items from inventory changeAmount( 'Flints', -2 ) -- take items from inventory changeAmount( 'Arrows Crafted', 1) -- adds crafted item to inventory for exp g_exp = g_exp + 10 -- adds exp PromptDuration ( "You Crafted 10 Arrows", 3000 ) elseif bt_clicked == 'byPie' and (foraged['Berries'].amount >= 2 and g_watercollected >= 2 and foraged['Tubers'].amount >= 2) then changeAmount( 'Berries', -2 ) -- subtract berries from inventory g_watercollected = g_watercollected - 2 -- subtract water from inventory changeAmount( 'Tubers', -2 ) -- take items from inventory SetPlayerHealth( g_PlayerHealth + 21 ) AddPlayerHealth( 40 ) g_exp = g_exp + 10 -- adds exp PromptDuration ( "Eat Berry Pie", 3000 ) elseif bt_clicked == 'bySoup' and (foraged['Berries'].amount >= 2 and g_watercollected >= 2) then changeAmount( 'Berries', -2 ) -- subtract berries from inventory g_watercollected = g_watercollected - 2 -- subtract water from inventory SetPlayerHealth( g_PlayerHealth + 11 ) AddPlayerHealth ( 40 ) g_exp = g_exp + 10 -- adds exp PromptDuration ( "You eat some Berry Soup", 3000 ) elseif bt_clicked == 'mtPie' and (foraged['Berries'].amount >= 2 and g_watercollected >= 2 and foraged['Tubers'].amount >= 2 and g_meatcollected >= 2) then changeAmount( 'Berries', -2 ) -- subtract berries from inventory g_watercollected = g_watercollected - 2 -- subtract water from inventory changeAmount( 'Tubers', -2 ) -- take items from inventory g_meatcollected = g_meatcollected - 2 -- subtract meat from inventory SetPlayerHealth( g_PlayerHealth + 41 ) AddPlayerHealth ( 40 ) g_exp = g_exp + 10 --adds exp PromptDuration ( "You Eat Meat & Berry Pie", 3000 ) elseif bt_clicked == 'mtSoup' and (g_watercollected >= 2 and g_meatcollected >= 2) then g_watercollected = g_watercollected - 2 -- subtract water from inventory g_meatcollected = g_meatcollected - 2 -- subtract meat from inventory SetPlayerHealth( g_PlayerHealth + 31 ) AddPlayerHealth( 40 ) g_exp = g_exp + 10 --adds exp PromptDuration ( "You eat Meat Soup", 3000 ) elseif bt_clicked == 'shelter' and (foraged['Wood'].amount >= 2 and foraged['Fibers'].amount >= 2) then changeAmount( 'Wood', -2 ) --take items from inventory changeAmount( 'Fibers', -2 ) --take items from inventory g_shelter = g_shelter + 1 -- add shelter to inventory g_exp = g_exp + 50 -- adds exp PromptDuration ( "You have crafted a shelter", 3000 ) elseif bt_clicked == 'stove' and (foraged['Wood'].amount >=2 and foraged['Flints'].amount >=2) then changeAmount( 'Wood', - 2 ) --take items from inventory changeAmount( 'Flints', - 2 ) --take items from inventory g_cooker = g_cooker + 1 -- add fire to inventory g_exp = g_exp + 50 -- adds exp PromptDuration ( "You have crafted a cooker", 3000 ) elseif bt_clicked == 'wkbench' and (foraged['Wood'].amount >= 2 and foraged['Flints'].amount >= 2 and foraged['Iron'].amount >= 4) then changeAmount( 'Wood', -2 ) --take items from inventory changeAmount( 'Flints', -2 ) --take items from inventory changeAmount( 'Iron', -4 ) --take items from inventory g_workbench = g_workbench + 1 g_exp = g_exp + 100 -- adds exp PromptDuration ( "You have crafted a Workbench", 3000 ) elseif bt_clicked == 'pistol' and (g_pistol >= 1) then AddPlayerWeapon( makeAbleEntities['Pistol'] ) -- number of the Pistol entity goes here changeAmount( 'Pistols', -1 ) PromptDuration ( "Pistol Used", 3000) elseif bt_clicked == 'pAmmo' and (g_pistol_ammo >= 1 ) then AddPlayerAmmo( makeAbleEntities['pAmmo'] ) -- number of the Pistol Ammo entity goes here changeAmount( 'Pistol Ammo', -1 ) PromptDuration ( "Pistol Ammo Used", 3000 ) elseif bt_clicked == 'rifle' and (g_rifle >=1 ) then AddPlayerWeapon( makeAbleEntities['Rifle'] ) -- number of the Rifle entity goes here changeAmount( 'Rifles', -1 ) PromptDuration ( "Rifle Used", 3000 ) elseif bt_clicked == 'rAmmo' and (g_rifle_ammo >= 1 ) then AddPlayerAmmo( makeAbleEntities['rAmmo'] ) changeAmount( 'Rifle Ammo', -1 ) PromptDuration ( "Rifle Ammo Used", 3000 ) elseif bt_clicked == 'dressing' and (g_bandages >= 1 ) then AddPlayerHealth( 50 ) g_bandages = g_bandages - 1 PromptDuration ( "Dressing Used", 3000 ) elseif bt_clicked == 'mediKit' and (g_medipack >= 1 ) then AddPlayerHealth( 100 ) g_medipack = g_medipack - 1 PromptDuration ( "Medikit Used", 3000 ) elseif bt_clicked == 'antidote' then PromptDuration ( "Antidote Used", 3000 ) elseif bt_clicked == 'booster' then PromptDuration ( "Booster Used", 3000 ) elseif bt_clicked == 'recipes' then -- change menu HideSprites() currMenu = 'recipes' RecipeMenuActivated() end elseif currMenu == 'recipes' then -- Recipe stuff in here for k, v in pairs( RecipeButtons ) do if g_MouseX > v.x and g_MouseX < v.x + v.w and g_MouseY > v.y and g_MouseY < v.y + v.h then bt_clicked = k break end end if bt_clicked == 'none' then return end --PromptDuration( bt_clicked , 2000 ) if bt_clicked == 'recipes' then HideSprites() currMenu = 'Main' MainMenuActivated() end end end function survival_inventory_main( e ) local baseOsT = nil local weaponId = nil function survival_inventory_main( e ) local T = os.time() if baseOsT == nil then baseOsT = T end TextColor(3, 94, tSize + 2, os.date("You have survived for %X", T - baseOsT) , 252, 3, 47) if string.lower(GetInKey()) == "i" then if not pressed then pressed = true if MouseActive then MouseActive = false MouseDeactivated() else MouseActive = true ActivateMouse() currMenu = 'Main' MainMenuActivated() end end else pressed = false end if MouseActive then local foraged = g_foraged if weaponId == nil then weaponId = GetPlayerWeaponID() end SetPlayerWeapons(0) SetSpritePosition ( Cursor , g_MouseX ,g_MouseY ) if g_MouseClick == 1 then if not MouseDown then MouseDown = true HandleMouseClicks( foraged ) end else MouseDown = false end if currMenu == 'Main' then ShowMainMenu(foraged) elseif currMenu == 'Recipes' then ShowRecipesMenu() end else DeactivateMouse() end end end