Forum

> > CS2D > Scripts > Gate Field
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Gate Field

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Gate Field

Fehu
User Off Offline

Zitieren
•Can anyone help me?•
I need script, if player move on gate field, then speedmod -10.
Thx for help!

alt Re: Gate Field

TimeQuesT
User Off Offline

Zitieren
this is easy -.-

just check the position and the type of all objects when the player reached a new tile.(use hook "movetile")
Spoiler >

alt Re: Gate Field

Fehu
User Off Offline

Zitieren
yea i trying like you say, and no errors, but player speedmod is 0, no -10.

//Edit
Its my code:
1
2
3
4
5
6
7
8
addhook("movetile","bb_slow")
function bb_slow(id,x,y)
	if (object(id,"typename")=="Gate Field") then
		if player(id,"tilex") and player(id,"tiley")==object(id,"tilex") and object(id,"tiley") then
			parse("speedmod "..id.." -10")
		end
	end
end

alt Re: Gate Field

TimeQuesT
User Off Offline

Zitieren
that can't work
you have to table all objects. like this:

local tab= object(0,"table");

then -->

for i=0,#tab do
......
if (object(i,"typename")=="Gate Field" and object(i,"tilex")==x etc.) then
....
end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht