Hey community, I'm totally new to GameGuru and LUA scripting, so please don't blame me.
So I tried modifying the default ammo.lua file, so that the character has to press E to pick ammo up, instead of only walking above it.
this is my Code:
function ammo_init(e)
end
function ammo_range(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 60 and g_PlayerHealth > 0 and g_PlayerThirdPerson==0 then
Prompt ("Press E to collect Ammo")
end
function ammo_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 60 and g_PlayerHealth > 0 and g_PlayerThirdPerson==0 and scancodekeypressed=18 then
PromptDuration("You collected some Ammo.",3000)
PlaySound(e,0)
AddPlayerAmmo(e)
Destroy(e)
ActivateIfUsed(e)
end
end
I'm getting the error
LUA ERROR!: scriptbank\ammo.lua:15 'then' expcted near '='
I'm not sure what to do. I hope you guys can help me out..
gretings.