Jump to content

Function in lua error


Recommended Posts

I GET THIS ERROR:::     2017-07-01 12:11:05 lua_scripts/cystom/buffers.lua:10: bad argument #1 to 'SendNotification' (string expected, got nil)



local npcid = 47

function morph_gossip(unit, player, creature)
    player:GossipMenuAddItem(0, "VIP Buffs", 0, 1)
    player:GossipSendMenu(1, creature)
function morph_select(event, player, creature, sender)
    if(player:GetGMRank() < 1) then
        player:SendNotification( message )
    elseif(player:GetGMRank() > 1) then
        player:AddAura(25898, player)
        player:AddAura(48469, player)
        player:AddAura(42995, player)
        player:AddAura(48169, player)
        player:AddAura(48073, player)
        player:AddAura(48161, player)
        player:AddAura(26035, player)
RegisterCreatureGossipEvent(npcid, 1, morph_gossip)
RegisterCreatureGossipEvent(npcid, 2, morph_select)

Link to comment
Share on other sites

The code you posted does not have message defined.
If you updated the code then please post it as the error you have is either different or you did nothing to the code or you did something but we dont really know what.

The argument must be a string!

Link to comment
Share on other sites

I don't think you're going to see a more specific or straightforward error message than this, ever.  It's telling you that the call to SendNotification on line 10 has a bad argument, that it is nil, when it expects a string. The argument there is the variable named 'message', which isn't defined anywhere in this script, hence the reason you're getting this error.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use