Quote: "Anyhow guys, is there a way for the script to call for g_ObjectId?"
Work with item name instead of item id, after all item name never change.
In the video I've 2 barrels, green barrel trigger the script and the blue store their name in a global var.
Green barrel destroy the blue one when player press E key.
If you want to try, just attach scripts as follow:
Attach this one to green barrel or whatever you want to trigger
ent_name = {}
function destroy_items_byname_init(e)
end
function destroy_items_byname_main(e)
if g_KeyPressE == 1 then
for i = 1,g_EntityElementMax,1 do
if g_Entity[i] ~= nil then
if ent_name[i] == "Barrel (Clean)" then
Destroy(i)
end
else
break
end
end
end --g_KeyPressE
end --main
And this one to the blue barrel
function get_items_names_init_name(e,name)
ent_name[e] = name
end
function get_items_names_main(e)
end --main
It works for me as you can see in the video below
hth
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