Jump to content
stefan100

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)
end
 
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)
        player:GossipComplete()
    end
end
 
RegisterCreatureGossipEvent(npcid, 1, morph_gossip)
RegisterCreatureGossipEvent(npcid, 2, morph_select)

Share this post


Link to post
Share on other sites

message is not defined.
What is message supposed to be? Did you mean a string like "message" ?

Share this post


Link to post
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!

  • Like 1

Share this post


Link to post
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.

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×
×
  • 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