Forum

> > CS2D > Scripts > Gate Field
Forums overviewCS2D overview Scripts overviewLog in to reply

English Gate Field

4 replies
To the start Previous 1 Next To the start

old Gate Field

Fehu
User Off Offline

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

old Re: Gate Field

TimeQuesT
User Off Offline

Quote
this is easy -.-

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

old Re: Gate Field

Fehu
User Off Offline

Quote
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

old Re: Gate Field

TimeQuesT
User Off Offline

Quote
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview