I see there is nothing new what would solve my problem. Nevermind, I got a new one (didn't want to start a new thread for this):
:SetUnitToFollow() does not work. Now i'm running a freshly compiled arcemu server without any problem so far. I was testing some lua functions including server hooks.
Code:
local bot
local jatekos
local van = false
function gyere_OnChat(event, plr, message, _type, language)
if (message == "gyere") then
jatekos = plr
if not van then
jatekos:SpawnCreature(50000, jatekos:GetX(), jatekos:GetY(), jatekos:GetZ(), jatekos:GetO(), jatekos:GetFaction(), 0)
van = true
else
bot:SendChatMessage(12, 0, "Itt vagyok mar...")
end
end
if (message == "takarodj") then
bot:Despawn(1000, 0)
van = false
end
end
RegisterServerHook(16, "gyere_OnChat")
function bot_OnSpawn(unit, event, plr)
bot = unit
bot:SendChatMessage(12, 0, "Hello")
bot:RegisterEvent("kovet_kezd", 1000, 1)
end
function kovet_kezd(unit, event, plr)
bot:SendChatMessage(12, 0, "Csa " ..jatekos:GetName())
bot:SetUnitToFollow(jatekos, 2, 1)
end
RegisterUnitEvent(50000, 18, "bot_OnSpawn")
So my npc spawns when I say "gyere" and despawns when I say "takarodj". Okay he also won't spawn if he already exists. Everything is just working fine expect the SetUnitToFollow.
Somewhere I read the 'angle' is not the angle so I wrote '1' there. Sill not working.
The red part is just a debug. He knows who "jatekos" (player) is, spamming the message with his name, but he won't follow the player.
Just wanted to know what I'm doing wrong
thank you!
EDIT:
I didn't find any error in the script so downloaded Stoneharry's Kronos repack. The same script worked without any error there. The unit was following me without any problems. Weird. The new arcemu does not support this lua function any more or what?