-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- Player Collects Weapon pressed = 0 local U = require "scriptbank\\utillib" function weapon3_init_name(e,name) weapon_name[e] = name Include( "utillib.lua" ) end function weapon3_main(e) if U.PlayerLookingAt( e, 150 ) then if g_PlayerGunCount < 9 then if g_PlayerGunID > 0 then if g_PlayerController==0 then PromptLocal (e,"Press E to pick up the " .. weapon_name[e] .. " or T to replace" ) else PromptLocal (e,"Press Y Button to pick up the " .. weapon_name[e] ) end else if g_PlayerController==0 then PromptLocal (e,"Press E To pick up the " .. weapon_name[e] ) else PromptLocal (e,"Press Y Button to pick up the " .. weapon_name[e] ) end end if g_KeyPressE == 1 and pressed == 0 then PromptDuration("Collected the " .. weapon_name[e],3000) PlaySound(e,0) AddPlayerWeapon(e) Destroy(e) ActivateIfUsed(e) pressed = 1 end else if g_PlayerController==0 then if g_PlayerGunID > 0 then PromptLocal (e,"Press T to replace with " .. weapon_name[e] ) else PromptLocal (e,"Cannot collect any more weapons" ) end else PromptLocal (e,"Cannot collect any more weapons" ) end end if GetScancode() == 20 and g_PlayerGunID > 0 and pressed == 0 then PromptDuration("Replaced with " .. weapon_name[e],3000) PlaySound(e,0) ReplacePlayerWeapon(e) Destroy(e) ActivateIfUsed(e) pressed = 1 end end if g_KeyPressE == 0 and GetScancode() ~= 20 then pressed = 0 end end