Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: medi4 on November 22, 2010, 10:49:46 pm
-
[center:3c29pyk1]Are you tired of appraise the yards distance between you and your target to create an awesome LUA script?[/center:3c29pyk1]
[center:3c29pyk1]Then I have the perfect LUA script for you![/center:3c29pyk1]
Just paste this code function Get_Distance(event, player, message, type, language)
local message = string.lower(message)
if (message == "yards") then
player:SendBroadcastMessage("It's "..player:GetDistanceYards(player:GetSelection()).." yards to your target.")
end
end
RegisterServerHook(16, "Get_Distance")
in a text file... rename it to yards.lua put it in your scripts folder and reload you lua engine.
Just say in-game yards and you'll get the exactly distance to your target
Credits:
medi4
stoneharry
-
Or just use ".distance":
{ "distance", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGetDistanceCommand>, "", NULL },
Doing the same, exception handled. Your script might fail without selection btw.
Doing it that way also provides the possibility to say ".distance someplayer".
-
well, your script is nice but you have to recompile your core... and in mine version you just have to put this in your script folder...
Your script might fail without selection btw.
:ufu: ofc but the meaning of my script is to know the distance to your selection?! so it makes no sense without a selection
-
As a mangos user I would prefer schlumpf's script, coz lua doesn't works. Both Good Scripts.
-
Uhm .. I did not supply a script but just wanted to note, that there already are chat commands for this. There is no need to make anything or linking "my script more", as there is no "my script" but just.. its already in the core.
-
well, .distance is a mangos command ??
i tried in arcemu...
-
Oh well, in that case. I did not really expect any difference between their command lists.
-
err (ähh auf englisch...), so it is mangos?