Forum

> > CS2D > Scripts > If player on tile (id) then slap each secound
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch If player on tile (id) then slap each secound

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt If player on tile (id) then slap each secound

EndDead
User Off Offline

Zitieren
Lets say the id is 1 and that id is from the tile-set, actully i don't want to slap but i will change whatever.

Pretty simple, but I am still not perfect in lua

in other words:
Check what tile ID is the player on and do a command/parse every secound/always.


Thanks in advance...

alt Re: If player on tile (id) then slap each secound

EndDead
User Off Offline

Zitieren
user DC hat geschrieben
If you want to do it with scripting anyway: This is the stuff you should use:

• cs2d lua hook second Lua hook
• a for loop that loops over all living players (cs2d lua cmd player(0,"tableliving")) in that hook
• cs2d lua cmd player to get the tilex / tiley and health of the players
• cs2d lua cmd parse with cs2d cmd sethealth if the tilex and tiley values are the ones that you are looking


is that for all tiles that the ID of it 1? or only for the tilex and tiley, cause i need the whole tiles with that id to have the effect,
if you havn't got me, Go to the editor move your mouse on a tile from the tile selection it will get something like "tile 1#, floor - dirt",
see the number 1#? i ment that.. if you understod me, gimme an example so i dont do any errors,
thanks in advance.

omg hat geschrieben
ust put hurt entities over the tiles; no need for scripting

I know almost every thing about mapping. i just wanted it on a script for a reason.
1× editiert, zuletzt 12.08.12 21:54:35

alt Re: If player on tile (id) then slap each secound

EndDead
User Off Offline

Zitieren
user DC hat geschrieben
In that case you can use the command cs2d lua cmd tile(x,y,"frame") with x=cs2d lua cmd player(id,"tilex") and y=cs2d lua cmd player(id,"tiley")


Well thanks, but i also said:
EndDead hat geschrieben
if you understod me, gimme an example so i dont do any errors


thanks in advance, and sorry for being noobish or something.

alt Re: If player on tile (id) then slap each secound

EndDead
User Off Offline

Zitieren
user SkullzOrig hat geschrieben
addhook ("walkover, phurt")
walkover == tile x, y
phurt [player .. id .. dmg]

Idk, something like that I guess.


I dont think it's correct.

Btw i found an example:
Water in tiba, when you step in it you move back.
thats fine but if you can add a secound hook and slap it would be better...
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht