• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] GetPlayerGUID

Status
Not open for further replies.

Neccta

Exalted Member
I know I'm missing something really simple here. I get an error saying "Bad argument #1 to `GetPlayerGUID` <number expected, got nil>
Code:
if (intid == 2) then
guid = GetPlayerGUID(lowguid)
print(guid)
end
 

Tommy

Founder
I know I'm missing something really simple here. I get an error saying "Bad argument #1 to `GetPlayerGUID` <number expected, got nil>
Code:
if (intid == 2) then
guid = GetPlayerGUID(lowguid)
print(guid)
end

Can you link more code? As far as I see nothing looks wrong, but more code would probably help identify the issue if it exists somewhere else.
 

Neccta

Exalted Member
I discoved that 'GetGUIDLow' works. Here is the full code anyway.

Code:
local NPC_ID = 4629


function Gossip(event, plr, unit)
     plr:GossipMenuAddItem(7, "Hello World", 0, 1)
	 plr:GossipMenuAddItem(2, "Test", 0, 2)
	 plr:GossipSendMenu(1, unit)
end

function Gossip_Select(event, player, unit, sender, intid, code)

if (intid == 1) then
 -- Do Something 
end

if (intid == 2) then
guid = player:GetGUIDLow()
print(guid)
end
        player:GossipComplete()
end

RegisterCreatureGossipEvent(NPC_ID, 1, Gossip)
RegisterCreatureGossipEvent(NPC_ID, 2, Gossip_Select)
 

Kaev

Super Moderator
Shouldn't it be Player::GetGUID() instead of GetPlayerGUID()?

EDIT: Nevermind, problem was solved already.
 
Status
Not open for further replies.
Top