eluna-scripts-ornfelt/lua/WowEmulationScriptPack/Lua/finished/PlayerEmote.lua
2024-09-23 07:59:23 +02:00

39 lines
No EOL
1.3 KiB
Lua

local function PlayerEmotePlay(event, player, command)
if (command:find("emote") ~= 1) then
return
end
local pattern = "%S+" -- Separate by spaces
local parameters = {}
local parameters = getCommandParameters(command)
local param2 = tostring(parameters[2])
local param3 = tostring(parameters[3])
if (param2 == "loop") then
local emoteID = tonumber(param3)
if (emoteID == nil or emoteID >= 477 or emoteID < 0) then
player:SendBroadcastMessage("Missing or invalid emote ID.")
return false
else
player:EmoteState(emoteID)
return false
end
elseif (param2 == "stop") then
player:Emote(0)
player:EmoteState(0)
return false
else
local emoteID = tonumber(param2)
if (emoteID == nil or emoteID >= 477 or emoteID < 0) then
player:SendBroadcastMessage("Missing or invalid emote ID.")
return false
else
player:Emote(emoteID)
return false
end
end
end
RegisterPlayerEvent(42, PlayerEmotePlay)