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

player:IsLeader()

Status
Not open for further replies.

Lightning Blade

BETA Tester
I tried that but just doesn't work. It says " returns a nil value " whenever i try to do what this script is suppose to do.
 

Tommy

Founder
It's a boolean and if you look in LuaFunctions.cpp and search for 'IsLeader', you will find it's arguments. It is also a group method, not a player method.

// :IsLeader("name"/Player)

It works like:

Code:
local group = player:GetGroup()
if (group ~= nil) then
    if (group:IsLeader(player:GetName()) then
    end
end
 

Tommy

Founder
Code:
plr:GossipSendMenu(1, unit)

"unit" should be creature on both of those methods.

Also, your gossip menus "OnSelect" won't be seen because you're missing GossipSendMenu(1, creature) and you're missing an end to close your if statement, also, your OnSelect function arguments are wrong. It should be "event, player, ceature, sender, intid, code"

Code:
function OnSelect(event, player, ceature, sender, intid, code)
    if(intid == 1) then
        plr:GossipMenuAddItem(0, "", 0, 101)
        plr:GossipMenuAddItem(0, "Tell me more about it", 0, 101)
        plr:GossipSendMenu(1, creature)
   end 
end

It seems as if you're guessing. If you aren't sure about anything, look on the wiki: http://wiki.emudevs.com/doku.php?id=eluna
 
Last edited:

Tommy

Founder
I already told you why. Also, instead of saying you have an issue, paste your new code..
 

Tommy

Founder
It's the exact same -.-. I've just added gossipcomplete and fixed the menu sender.


Okay, but you didn't read my post above thoroughly:

Code:
plr:GossipSendMenu(1, unit)

"unit" should be creature on both of those methods.

Also, your gossip menus "OnSelect" won't be seen because you're missing GossipSendMenu(1, creature) and you're missing an end to close your if statement, also, your OnSelect function arguments are wrong. It should be "event, player, ceature, sender, intid, code"

Code:
function OnSelect(event, player, ceature, sender, intid, code)
    if(intid == 1) then
        plr:GossipMenuAddItem(0, "", 0, 101)
        plr:GossipMenuAddItem(0, "Tell me more about it", 0, 101)
        plr:GossipSendMenu(1, creature)
   end 
end

It seems as if you're guessing. If you aren't sure about anything, look on the wiki: http://wiki.emudevs.com/doku.php?id=eluna
 

Lightning Blade

BETA Tester
You updated it after first time i read it.

- - - Updated - - -

But that didn't fix the problem.

- - - Updated - - -

I'm not using the sender nor code, so it doesn't affect my function.
 

Tommy

Founder
You updated it after first time i read it.

- - - Updated - - -

But that didn't fix the problem.

- - - Updated - - -

I'm not using the sender nor code, so it doesn't affect my function.

Regardless, it is still wise to add all the arguments.

Figured it out this is how my argument list should look like " event, plr, creature, arg2, intid "

Should be:

Code:
event, player, creature, sender, intid, code

Just so people won't get confused if you don't have all the arguments there. I add all the arguments despite if I'm going to use them or not.
 
Status
Not open for further replies.
Top