Forum
CS2D Scripts Speedmod on TileSpeedmod on Tile
2 replies 1
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
addhook("movetile","_mt") function _mt(id,x,y) 	if x == 10 and y == 12 then -- single tile that changes speed 		parse("speedmod "..id.." 20") 	elseif x >= 15 and x <= 18 and y >= 10 and y <= 11 then -- an area that changes speed 		parse("speedmod "..id.." 10") 	else -- all other cases (should default to resetting speed to default) 		parse("speedmod "..id.." 0") 	end end
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("movetile","_movetile") function _movetile(id,tilex,tiley) 	if string.sub(tostring(entity(tilex,tiley,"name")),1,5)=="speed" then 		local speed=string.sub(tostring(entity(tilex,tiley,"name")),6,10) 		parse("speedmod "..id.." "..speed) 	end end
place any entity(for example "trigger_start") and name it "speed 50", then place one nearby with name "speed 0". So anytime you step on them you'll be set different speed.
1