Forum

> > CS2D > Scripts > Removing all buildings
Forums overviewCS2D overview Scripts overviewLog in to reply

English Removing all buildings

2 replies
To the start Previous 1 Next To the start

old Removing all buildings

Masea
Super User Off Offline

Quote
Hello bros, since the us.de is ok at least for now, let me exploit this time and create another thread which is about a problem.

I want to remove all buildings in the map. So I'm using cs2d cmd killobject, that's fine, removes all buildings but also removes the other things like images. Yeah, that is the problem here. I only want to remove all buildings, no others.

I just tried few things but I didn't get the correct code yet;
1
2
3
4
5
6
local objectlist=object(0,"table")
for _,id in pairs(objectlist) do
	if object(id,"health") > 0 then
		parse("killobject "..id)
	end
end
1
2
3
4
5
6
local objectlist=object(0,"table")
for _,id in pairs(objectlist) do
	if object(id,"type") <= 23 then
		parse("killobject "..id)
	end
end

I hope you guys understand me!
Thanks.

old Re: Removing all buildings

Yates
Reviewer Off Offline

Quote
The second dump of code seems fine. What does
print(object(id, "type"))
return for you?

Also, does
parse("killobject "..id)
even get executed?

old Re: Removing all buildings

Masea
Super User Off Offline

Quote
Oh lol, there was a small fault that I did. Sorry.
By the way, the second code and command works smoothly.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview