Forum

> > CS2D > Scripts > Need solution for "Move" hook.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need solution for "Move" hook.

1 reply
To the start Previous 1 Next To the start

old Need solution for "Move" hook.

Rainoth
Moderator Off Offline

Quote
More >


If this was "move" hook it would work on moving. However when moving you change pixel position a lot of times, so it looks like I shoot snowball rays around me.. How can I change it so this would trigger on movetile. (now I changed to movetile hook and i get no errors but also NOTHING happens..)

old Re: Need solution for "Move" hook.

Alistaire
User Off Offline

Quote
Add something like;

1
2
3
if math.random(1, 10) == 1 then
	//shoot snowballs and shit
end

in a movehook, so it triggers only occasionaly.

----

Or you could make it a movehook, but add a counter (if counter[id] == 32 then shoot stuff) for them.

Your current error is that a move hook returns tilex and tiley, but your player and spawnprojectile things are pixelx and pixely.

You could do something like;

1
local x, y = x * 32 + 16, y * 32 + 16

To make the projectiles spawn in the center of the tile, or;

1
local x, y = player(id, 'x'), player(id, 'y')
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview