Forum

> > CS2D > Scripts > An action while players have same positions.
Forums overviewCS2D overview Scripts overviewLog in to reply

English An action while players have same positions.

8 replies
To the start Previous 1 Next To the start

old Re: An action while players have same positions.

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("movetile","hue")
function hue(id,x,y)
	for k,v in pairs (player(0,"tableliving")) do
		if v ~= id and player(v,"tilex") == x and player(v,"tiley") == y then
			msg"Two Ppl on same tile"
		end
	end
end

Note: changes may apply if you use different hooks

old Re: An action while players have same positions.

VADemon
User Off Offline

Quote
Btw, the script user Rainoth provided only triggers once (onEvent, when) unlike the title says "while". If you want to get it working as a "while" then store the two players in a variable when the condition is true in the movetile hook and empty the variable when the condition is false for one of these players. To get it working, use either "always" or "ms100" hook to check this variable frequently.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview