Thanks, I corrected and tested it. Works only 50% :\
It converts the normal party to raid if I'm already in a party, but crashed my world.exe if i'm not in a party.
Here's my modified code. I changed the hook so it's easier to test now. Typing -lfg runs the script
Code:
local RAID_MSG = "-lfg"
function Raid_OnChat(event, player, message, type, language, unit)
if(message == RAID_MSG) then
local players = GetPlayersInWorld()
for a,plr in pairs(players) do
local leader = plr:GetGroupLeader()
if leader ~= nil then -- to check if the player has a leader
if leader:GetGroupType() == 0 then
leader:ExpandToRaid()
end
end
if leader:IsGroupFull() ~= true then
player:AddGroupMember(leader) -- "player who joins":AddGroupMember("leader's group") it works like this :\
end
end
end
end
RegisterServerHook(16, "Raid_OnChat")