Hi,
i wanna make a quest where you have to collect 8 oranges.
Everything works fine, but when i add a "destroy(e)" to the script, it shows me up this:
"scriptbank\muhlberg\orange_quest.lua:15: attempt to call global 'destroy' (a nil value)"
i wanted to make that if you collect an orange, it disappears so that you cant collect the same orange 8-times.
my script:
function orange_quest_init(e)
sammeltime = 0
end
function orange_quest_main(e)
PlayerDistOrange = GetPlayerDistance(e)
if PlayerDistOrange < 60 and nebenquest==1 and nebenressource < 8 then
Prompt("E zum Sammeln druecken")
if g_KeyPressE==1 and GetTimer(e)>sammeltime then
sammeltime=GetTimer(e)+1000
destroy(e)
nebenressource = nebenressource+1
end
end
end
*just to explain:
i use "nebenquest" to check if the quest is active.
and "nebenressource" is the count of oranges.