Forum

> > CS2D > Scripts > Distance chat
Forums overviewCS2D overview Scripts overviewLog in to reply

English Distance chat

1 reply
To the start Previous 1 Next To the start

old Distance chat

Flame
BANNED Off Offline

Quote
How to make like in rpg tibia when u cant see a player then player cant see ur messages but when u see a player he can

old Re: Distance chat

Apache uwu
User Off Offline

Quote
Like This?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","_say")
addhook("sayteam","_say")

max_dist=20 --max range for message to be heard in tiles

function _say(id,message)
	if player(id,"health")>0 then
		for _,id2 in ipairs(player(0,"tableliving")) do
			if math.abs(player(id,"tilex")-player(id2,"tilex"))<max_dist and math.abs(player(id,"tiley")-player(id2,"tiley"))<max_dist then
				msg2(id2,player(id,"name")..": "..message)
			end
		end
	end
return 1
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview