hi there! i have an urgent problem. i need a script to complete my game.
i have a script that is for the "collected object" and now it is from the "blow up the ant eggs" script. i does the following:
i get near the object and a text appears (press e to activate)
when i press e the killcount is +1 and the object explodes.
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Detonate a supply dump and count
destroy_started = {}
function timecharge_init(e)
destroy_started[e]=0
end
function timecharge_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist<250 and destroy_started[e] == 0 then
Prompt ("Press E To pick up the plant charge")
if g_KeyPressE == 1 then
destroy_started[e] = GetTimer(e)+3000
PlaySound(e,0)
end
end
if destroy_started[e]>0 then
if GetTimer(e) > destroy_started[e] then
SetEntityHealth(e,0)
KillCount = KillCount + 1
destroy_started[e]=0
end
end
if g_Entity[e]['health'] <= 0 then
StopSound(e)
end
end
i would like to change it, i want the player to collect the item it must disappear but it shall NOT explode. i found out that disappearing is "destroy(e)" but i can't take away the explodion. the killcount will go +1 up that is good, this must stay. i want the player to collect 6 engine parts f.e. and when he has 6 he is allowed to pass a door. this all works but the items explode and kill the player.
can you help me with this script?
thanks!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti