Scripts / Script for destroy entity

Author
Message
0Timon0
6
Years of Service
User Offline
Joined: 22nd Aug 2017
Location:
Posted: 3rd Jul 2022 21:14
Previously used such a script to delete an object:

-- LUA Script - precede every function and global member with lowercase name of script
function build_remove1_init(e)
end
function build_remove1_main(e)
if g_Entity[e]['plrinzone']== 1 then
Destroy(e)
ActivateIfUsed(e)
Destroy(95)
end
end

Now it doesn't work. Could this be related to the new version?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th Jul 2022 08:54
Possibly because 95 is no longer the entity Id?

You shouldn't use explicit Id btw, they are likely to change if you edit your map.
Been there, done that, got all the T-Shirts!
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 4th Jul 2022 09:28
Or maybe Destroy(e) is removing the trigger zone, before destroying the entity you want to destroy (95)
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 18th Jul 2022 05:51
I think both situations are problematic.
Store Assets - Store Link
Free Assets - Resource Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960

Login to post a reply

Server time is: 2024-02-27 22:13:34
Your offset time is: 2024-02-27 22:13:34