I Was looking through Ownedcore today and I found this awesome custom BG script created by stoneharry! In the script he has a temorary function that allows players to join the Queue from typing #joinbg
This is whats in the script....
function OnChat_Hook_ToJoinBG(event, plr, message, pType, pLanguage, pMisc)
local message = string.lower(message)
if message == "#joinbg" then
JoinQue(plr)
elseif message == "#finbg" then
ResetBG()
end
if message == "test" then
if math.random(1,2) == 1 then
local pack = LuaPacket:CreatePacket(SMSG_UPDATE_WORLD_STATE,
pack:WriteULong(2314) -- ID
HordeLives = HordeLives - 1
pack:WriteULong(HordeLives) -- Amount, Horde
plr:SendPacketToPlayer(pack)
else
local pack = LuaPacket:CreatePacket(SMSG_UPDATE_WORLD_STATE,
pack:WriteULong(2313) -- ID
AllianceLives = AllianceLives - 1
pack:WriteULong(AllianceLives) -- Amount, Alliance
plr:SendPacketToPlayer(pack)
end
end
end
I want to make It so you can queue up for the bg using a npc. I created this part below but it doesn't work I get a error that says player is nill value.
function BG_OnGossip(Unit, Event, Player)
Unit:GossipCreateMenu(100, Player, 0)
Unit:GossipMenuAddItem(0, "Click Here To leave the battle.", 1, 0)
Unit:GossipSendMenu(Player)
end
function BG_OnSelect(Unit, Event, Player, MenuId, id, Code)
if (id == 1) then
JoinQue(plr)
player:GossipComplete(player)
end
end