Forum

> > CS2D > Scripts > Object script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Object script

12 replies
To the start Previous 1 Next To the start

old Object script

Smile-Rus
User Off Offline

Quote
All hello. The script on object destruction is necessary to me. If i destroy a(Env_Breakable) to appear a smoke.

old Re: Object script

Kel9290
User Off Offline

Quote
1
2
3
4
5
6
addhook("objectkill","_obj")
function _obj(i,p)
	if object(i,"tilex") == YOUR_ENTITY_POSITION_IN_TILE_X and object(i,"tiley") == YOUR_ENTITY_POSITION_IN_TILE_Y then
		parse("effect smoke "..object(i,"x").." "..object(i,"y").." 5 10")
	end
end
^
not tested
http://cs2d.com/help.php?cat=all&cmd=effect#cmd

old Re: Object script

Bowlinghead
User Off Offline

Quote
1
2
3
4
addhook("objectkill","lol")
function lol(x,y)
	parse('effect "colorsmoke" '..x..' '..y..' 0 0 255 010 010')
end

I think its work!
EDIT: 40 seconds

old Re: Object script

Autumn
User Off Offline

Quote
hey guys it does not work. It is necessary for me that after destruction Env_Breakable on its place there was a smoke.
Points Env_Breakable (x=33,y=133)
Spoiler >

I not so have made?

old Re: Object script

Bowlinghead
User Off Offline

Quote
The addhook is wrong!
1
2
3
4
addhook("break","lol")
function lol(x,y)
     parse('effect "colorsmoke" '..x..' '..y..' 0 0 255 010 010')
end


objectkill is from wall1, turrets and so on!

old Re: Object script

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
addhook("break","lol")
function lol(x,y)
parse('effect "smoke" '..(x*32+16)..' '..(y*32+16)..' 32 32')
end

I do believe the problem should be solved.

old Re: Object script

Autumn
User Off Offline

Quote
Yes, now it works, thanks. But how to make that a smoke went only from this (Env_Breakable) (x=33, y=133)?Because so after destruction of any (Env_Breakable) there is a smoke.

old Re: Object script

Kel9290
User Off Offline

Quote
1
2
3
4
5
6
addhook("break","lol")
function lol(x,y)
	if x==33 and y==133 then
		parse('effect "smoke" '..(x*32+16)..' '..(y*32+16)..' 32 32')
	end
end

old Re: Object script

Apache uwu
User Off Offline

Quote
Actually you could do this in the map editor.

Since breakables are placed constantly in the map, there is no point of using a script to control this. Since your won't be able to move the breakables or add them in game.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview