Jump to content

Marshmelloen

Member
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Marshmelloen's Achievements

  1. Mod location: steamapps/ common/ PZ/ mods/ ModName/ Media, mod.info/ Media/ Lua/ Shared/ EatableToothpaste.lua I need help with just checking if the way i wrote the script is correct or any wrong or errors I can't find any trace of the local file in the PZ mod menu My mod.info: { "name": "Eatable Toothpaste", "id": "ToothpasteEatMod", "description": "Eat Toothpaste", "authors": "Marshmelloen", "version": "1.0", "requires": "No required mods", "lua": "media/lua/EatableToothpasteScript.lua" } script: EatToothpaste = {} EatToothpaste.perform = function(player, item) if item:getType() == "Toothpaste" then player:getStats():setHunger(player:getStats():getHunger() + 8) player:getStats():setThirst(player:getStats():getThirst() - 10) player:getStats():setStress(player:getStats():getStress() - 20) player:getInventory():Remove(item) player:getEmitter():playSound("EatFood") player:Say("You eat the toothpaste. It doesn't taste great, but it helps with hunger.") player:getStats():sync() end end EatToothpasteAction = {} EatToothpasteAction.type = "EatToothpaste" EatToothpasteAction.maxTime = -1 EatToothpasteAction.actionAnim = "Eat" EatToothpasteAction.OnFillContextMenu = function(player, items, context) if not context:isReallyVisible() then return end if items:size() > 0 then local item = items:get(0) if item:getType() == "Toothpaste" then context:addOption("Eat Toothpaste", item, EatToothpaste.perform) end end end -- Register the item action Events.OnFillInventoryObjectContextMenu.Add(EatToothpasteAction.OnFillContextMenu)
  2. I need help on making a mod that would be great to have for the entire community. but I have tried everything of my own knowledge on how to do it but can't figure out how. My goal is to make a simple mod where you can attach light sources on your belt I just need help with the coding part mabye I am doing it completely wrong. Pls help.
×
×
  • Create New...