local colshape = createColSphere(tonumber(x), tonumber(y), tonumber(z), tonumber(radius))
If you create colshape, and not delete it it will stay on map until resource restart, wanna see? After using your command follow steps below.
Execute this command in admin panel (Resources > Execute command)
for client & server.
And then, simply write:
I've added additional element data check, so if vehicle doesn't have such element data, it wouldn't compare number with boolean. Besides, my version of code is somewhat faster, because of integer loop (you can't really see difference, but it's better to use it anyways)
Why after all people use ipairs without sensible reason? I don't know, maybe because some of them lazy, or they don't even know that you can use int loop.