What am I trying to do is; before checking if there isn't any flare on the elected place, then I'm spawning a flare on the coordinates where I checked. With this script, I will achieve of making a light entity without using map editor by Lua. I know, the flare's light effect is red but who cares, screw it!
1
2
3
4
2
3
4
for a,b in pairs(projectilelist(1,0)) do 	if projectile(b.id,1,"exists") and projectile(b.id,1,"x") == v[3]*32+16 and projectile(b.id,1,"y") == v[4]*32+16 and projectile(b.id,1,"type") == 54 then return end end parse("spawnprojectile 1 54 "..(v[3]*32+16).." "..(v[4]*32+16).." 1 0")
However, since I was not laboring with this kind stuff, I couldn't do this.
Here are my questions:
1
for a,b in pairs(projectilelist(1,0)) do
The code itself doesn't work. The command works perfect though, but the above does not.
I hope you understand me and will help me as a good guy.
edited 2×, last 24.10.16 05:46:27 pm