Line 9 comes back as an argument because I think it should say "tostring(Unit:GetGUID())" instead of Unit:"GetGUID()". The unit I'm tring to manipulate says that his GUID is actually A2000003 and not the number that shows up when I use the command ".N I".
For the top area before line 9 it works for every guard NPC (As I think you intended it to) so thats how I get the GUID of A2000003.
When I remove line 9 the script loads perfectly with no arguments at all. But from what I can somewhat grasp, something is going on on the line "if GUID == Unit:GetGUID() then" because the script should work. I think something is going on with the GUID.
I broke the script into a fragment of what you have and just put it down to:
Code:
function CDarrowGuard001_01(Unit, Event)
-- local Guard = Unit:GetUnitByGUID(-1577058301)
local Guard = Unit:GetUnitBySqlId(142170)
local GUID = Guard:GetUnitByGUID()
if GUID == Guard:GetUnitByGUID() then
Guard:SendChatMessage(12, 7, "working")
Unit:MoveTo(949.457764, -2500.565918, 57.704636, 2.952302)
Guard:RegisterEvent("CDarrowGuard001_02", 1000, 1)
end
end
function CDarrowGuard001_02(Unit, Event) -- We can use Unit now since all the unit we are trying to control registered the event
Unit:MoveTo(1025.368042, -2514.938477, 59.142624, 1.279398)
Unit:RegisterEvent("CDarrowGuard001_03", 30000, 1)
end
function CDarrowGuard001_03(Unit, Event)
Unit:MoveTo(1037.240479, -2463.902832, 60.313976, 0.677783)
Unit:RegisterEvent("CDarrowGuard001_04", 5000, 1)
end
function CDarrowGuard001_04(Unit, Event)
Unit:MoveTo(1075.207764, -2438.461914, 61.268898, 0.807374)
end
RegisterUnitEvent(90018, 18, "CDarrowGuard001_01")
To make sure that the MoveTo commands were working and they were, so i(in my mind) has to be some sort of problem with the GUID.
Currently the script looks like this:
Code:
function CDarrowGuard001_01(Unit, Event)
-- local Guard = Unit:GetUnitByGUID(-1577058301)
local Guard = Unit:GetUnitBySqlId(142170)
Unit:SendChatMessage(12,0,tostring(Guard)) -- this is the unit we are checking for
local GUID = Guard:GetGUID()
Unit:SendChatMessage(12,0,tostring(GUID))
Unit:SendChatMessage(12, 0, Unit:GetGUID()) -- this is the unit calling the event
if GUID == Unit:GetGUID() then -- if unit calling event = unit we are looking for
Unit:SendChatMessage(12,0,"The GUID's match!") -- send message
Unit:MoveTo(949.457764, -2500.565918, 57.704636, 2.952302)
Unit:RegisterEvent("CDarrowGuard001_02", 10000, 1)
end
end
function CDarrowGuard001_02(Unit, Event) -- We can use Unit now since all the unit we are trying to control registered the event
Unit:MoveTo(1025.368042, -2514.938477, 59.142624, 1.279398)
Unit:RegisterEvent("CDarrowGuard001_03", 10000, 1)
end
function CDarrowGuard001_03(Unit, Event)
Unit:MoveTo(1037.240479, -2463.902832, 60.313976, 0.677783)
Unit:RegisterEvent("CDarrowGuard001_04", 5000, 1)
end
function CDarrowGuard001_04(Unit, Event)
Unit:MoveTo(1075.207764, -2438.461914, 61.268898, 0.807374)
end
RegisterUnitEvent(90018, 18, "CDarrowGuard001_01")
*Thanks for the help up till now*