Problem with pUnit:GetItemCount(20559) > 0 then   in LUA menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Pretzal's Avatar Member
    Reputation
    8
    Join Date
    Aug 2008
    Posts
    57
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with pUnit:GetItemCount(20559) > 0 then in LUA

    Well it says theres an error at line 32: unexpected symbol '>' and fails to load, i dont see what the problem is. Heres my script: :wave:

    I know my script is in progress but i wanna make sure its possible atleast before i complete it =C.

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(999999, player, 0)
    unit:GossipMenuAddItem(1, "Malls", 1, 0)
    unit:GossipMenuAddItem(1, "Remove Ressurection Sickness", 40, 0)
    unit:GossipMenuAddItem(1, "Convert Tokens", 7, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if(intid == 1) then
    unit:GossipCreateMenu(999, player, 0)
    unit:GossipMenuAddItem(1, "Alliance Mall", 5, 0)
    unit:GossipMenuAddItem(1, "Horde Mall", 6, 0)
    unit:GossipMenuAddItem(1, "[Back]", 66, 0)
    unit:GossipSendMenu(player)
    end
    
    
    unit:GossipSendMenu(player)
    end
    
    if(intid == 5) then
    player:Teleport(13, 107, -114, -98)
    end
    
    if(intid == 6) then
    player:Teleport(13, 109, 113, -144)
    end
    
    if(intid == 7) then
    pUnit:GetItemCount(20559) > 0 then                                   <--- This is line 32 !!!
    unit:GossipMenuAddItem(1, "Convert Arathi Token to Badge", 8, 0)
    pUnit:GetItemCount(20558) > 0 then
    unit:GossipMenuAddItem(1, "Convert Warsong Token to Badge", 9, 0)
    pUnit:GetItemCount(29024) > 0 then
    unit:GossipMenuAddItem(1, "Convert Eye of the Storm Token to Badge", 10, 0)
    pUnit:GetItemCount(20559) > 4 then
    unit:GossipMenuAddItem(1, "Convert 5x Arathi Token to Badge", 11, 0)
    pUnit:GetItemCount(20558) > 4 then
    unit:GossipMenuAddItem(1, "Convert 5x Warsong Token to Badge", 12, 0)
    pUnit:GetItemCount(29024) > 4 then
    unit:GossipMenuAddItem(1, "Convert 5x Eye of the Storm Token to Badge", 13, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 8) then
    pUnit:AddItem(29434)
    
    if(intid == 40) then
    player:LearnSpell(15007)
    player:UnlearnSpell(15007)
    unit:GossipCreateMenu(999999, player, 0)
    unit:GossipMenuAddItem(1, "Malls", 1, 0)
    unit:GossipMenuAddItem(1, "Remove Ressurection Sickness", 40, 0)
    unit:GossipSendMenu(player)
    end
    
    end
    RegisterUnitGossipEvent(5, 1, "On_Gossip")
    RegisterUnitGossipEvent(5, 2, "Gossip_Submenus")

    Problem with pUnit:GetItemCount(20559) &gt; 0 then   in LUA
  2. #2
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not an expert at Lua but i'm guessing that you have to place an "if" somewhere before u make your comparison.

    like: if x > 0 then
    not just: x >0 then cause here you're missing your IF statement

    Hopefully U know how to fix that yourself cause I certainly don't

  3. #3
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't use an operator (=, <, >) without having a conditional statement (if ... then) You have the then... just add the if


Similar Threads

  1. Problem with WPE
    By weedlord in forum World of Warcraft General
    Replies: 0
    Last Post: 08-14-2006, 03:35 AM
  2. Problem with BWH 1.11.2
    By gwl15 in forum World of Warcraft General
    Replies: 3
    Last Post: 08-11-2006, 05:37 PM
  3. Problem with CE.
    By Eldretch in forum World of Warcraft General
    Replies: 1
    Last Post: 08-08-2006, 06:49 PM
  4. I have problem with BHW 3.0
    By sunrize1 in forum World of Warcraft General
    Replies: 1
    Last Post: 07-17-2006, 08:49 AM
All times are GMT -5. The time now is 07:01 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search