English Distance chat

9 replies
Goto Page
To the start Previous 1 Next To the start
09.01.12 07:09:08 pm
Up
Flame
BANNED
Offline Off
Can sombody make me a lua like this :


In this distance player's can hear each other :

IMG:http://img824.imageshack.us/img824/7345/dedust00000.jpg


And in this distance player's can't hear each other :

IMG:http://img11.imageshack.us/img11/9017/dedust00003.jpg


Please if sombody can make this just post it here i really need it !
Rainbow for ever
09.01.12 07:16:59 pm
Up
Yates
Reviewer
Offline Off
That's not possible with Lua. Just hold shift (Sneak).
09.01.12 07:21:14 pm
Up
Flame
BANNED
Offline Off
I mean the chat thing... in small distance player's can see each other's words .
And in big distance they cant
Rainbow for ever
09.01.12 07:23:14 pm
Up
Alistaire
User
Offline Off
Making a co-op script? 0-0
IMG:http://i.imgur.com/5zhwOTP.png
09.01.12 07:32:14 pm
Up
Flame
BANNED
Offline Off
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

See when i write somthing 2 messages come ....

IMG:http://img820.imageshack.us/img820/3179/dedust00012.jpg
Rainbow for ever
09.01.12 07:43:59 pm
Up
EP
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function radiusmsg(words, x, y, radiusx, radiusy)
     print(words)
     if not (radiusx and radiusy) then radiusx, radiusy = 128, 128 end
     local x1, y1, x2, y2 = x-radiusx, y-radiusy, x+radiusx, y+radiusy
     for _, v in ipairs(player(0, 'table')) do
          if player(v, 'x') >= x1 and player(v, 'x') <= x2 and player(v, 'y') >= y1 and player(v, 'y') <= y2 then
               msg2(v,words)
          end
     end
     return 1
end


addhook("say","rmsg")
function rmsg(id,txt)
     text = "©255255000"..player(id,"name").." : "..txt
     radiusmsg(text, player(id, 'x'), player(id, 'y'), radiusx, radiusy)
     return 1
end
It will show the message to the players who are in the distance "x" and "y", in a square of 4x4 tiles, change it if you want
09.01.12 08:05:09 pm
Up
Flame
BANNED
Offline Off
I mean a lua that can show message if only player's are close to each other ... Like in RPG tibia
Rainbow for ever
09.01.12 08:28:30 pm
Up
EP
User
Offline Off
mine is from RPG Tibia =. =
09.01.12 08:29:59 pm
Up
Flame
BANNED
Offline Off
Well it's not a distance chat one...

So can anybody help me ;// ?
edited 1×, last 09.01.12 08:46:51 pm
Rainbow for ever
09.01.12 08:50:31 pm
Up
Ricardo Novais
User
Offline Off
i need this type of script too!
To the start Previous 1 Next To the start