Jump to content

Search the Community

Showing results for tags 'context:addOption'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • News
  • Project Zomboid
    • PZ Updates
    • General Discussions
    • Bug Reports
    • PZ Support
    • PZ Multiplayer
    • PZ Community & Creativity
    • PZ Suggestions
  • PZ Modding
    • Tutorials & Resources
    • Mods
    • Items
    • Mapping
    • Mod Ideas and Requests
  • General Games Development
    • Indie Scene
  • Other Discussions
    • General Discussion
    • Forum Games & Activities

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Twitter


Interests

Found 1 result

  1. hi everyone, i have recently been trying to get to grips with the world context menu. i can add an option if conditions are met, player clicks on ground outside and is grass/soil. the menu option displays, however the function i have linked to the menu option (a timed action) is always executed. i'm probably missing something very very simple however i keep looking at my code and it looks fine (well it looks terrible... but...) TL:DR context menu shows my option but always calls the function i have linked to it. function contextMenu(_player, _context, _worldObjects) if test then return ISWorldObjectContextMenu.setTest() end testVar = false; local player = getSpecificPlayer(_player); local square = nil; for i,v in ipairs(_worldObjects) do square = v:getSquare(); for t = 0, square:getObjects():size() - 1 do local item = square:getObjects():get(t); if item:getTextureName() and (luautils.stringStarts(item:getTextureName(), "floors_exterior_natural") or luautils.stringStarts(item:getTextureName(), "blends_natural")) then testVar = true; end end end if testVar then if test then return ISWorldObjectContextMenu.setTest() end _context:addOption("My Menu", _worldObjects, testfunc(player,"woop woop"), testVar, _player); end endfunction testfunc(player, msg) print(msg); ISTimedActionQueue.add(ISslowPoke:new(player, msg, 50));endEvents.OnFillWorldObjectContextMenu.Add(contextMenu)
×
×
  • Create New...