Hi Nathan38
I have just changed the ammo script to do most of what you ask...
-- Player Collects Ammo
local keypressed = 0
local playerMoney = 200
function get_ammo_init(e)
end
function get_ammo_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 80 then
if playerMoney < 50 then
PromptLocal(e, "You don't have enough money "..playerMoney)
else
PromptLocal(e, "Press E to purchase Ammo for 50 you have "..playerMoney)
if keypressed == 0 and g_KeyPressE == 1 then
PromptDuration("Collected ammo",3000)
PlaySound(e,0)
AddPlayerAmmo(e)
playerMoney = playerMoney - 50
--Destroy(e)
ActivateIfUsed(e)
keypressed = 1
end
end
end
if g_KeyPressE == 0 then
keypressed = 0
end
end
see how I use the keypressed variable to stop the g_KeyPressE from using up all your money..
the g_KeyPressE varriable is passed in by the GG main loop so you can't just set it to zero...
also the g_PlayerGunClipCount variable you are trying to use is a global variable passed in by GG main control loop
it is not a variable you can set... as the GG loop will continually change it back...as with the g_KeyPressE..
To Use..
I used the Uzi and placed 1 uzi ammo on the ground... I scaled the Ammo model bigger and attached this script to it..
Hope it helps you