Jump to content

Search the Community

Showing results for tags 'bodydamage'.

  • 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 2 results

  1. For the past month or so I've been working on further developing the DrHyde's Vaccine mod to suit the needs of PZ roleplaying servers. There is one feature I'd really like to implement but am unable to. Vaccinating OTHER PLAYERS -- how can I code a function that will change the other player's bodyDamage()? So far I've successfully added a UI-button to the HealthPanelUI that opens up when medically checking right-clicked player, but I just can't manage to add function that will change right-clicked player's stats. The code I'm using is simple: adds UI-button and a 'confirmPress' function that runs when that button is pressed. But how do I change the local function confirmPress(button, args) to apply changes to the other player's stats and not the one that initiates the button press (me)? Any help is appreciated-- please help me solve something that I couldn't figure out in a month worth of time.. -- Functions for button of UIs local function confirmPress(button, args) local player = getPlayer(); if player:getInventory():getItemFromType('CmpSyringeWithVirus') then if player:getInventory():getItemFromType('AlcoholedCottonBalls') then player:getBodyDamage():setInfected(true); player:getInventory():Remove("CmpSyringeWithVirus"); player:getInventory():Remove("AlcoholedCottonBalls"); else player:Say("Cotton balls?"); end--if else player:Say("Nothing to inject with.."); end--if end--function -- Add HealthPanelUI Syringe Button local ISHealthPanel_createChildren = ISHealthPanel.createChildren function ISHealthPanel:createChildren() ISHealthPanel_createChildren(self); self.fitness:setWidth(self.fitness:getWidth()/1.5); self.TOCButton = ISButton:new(self.fitness:getRight(), self.healthPanel.y, 20, 20, "", self, confirmPress); self.TOCButton:setImage(getTexture("media/ui/iconForMenu.png")); self.TOCButton.anchorTop = false self.TOCButton.anchorBottom = true self.TOCButton:initialise(); self.TOCButton:instantiate(); self:addChild(self.TOCButton); if getCore():getGameMode() == "Tutorial" then self.TOCButton:setVisible(false); end end local ISHealthPanel_render = ISHealthPanel.render function ISHealthPanel:render() ISHealthPanel_render(self); self.TOCButton:setY(self.fitness:getY()); end
  2. local leftUpperLeg = getPlayer():getBodyDamage():getBodyPart(BodyPartType.FromIndex(BodyPartType.ToIndex(BodyPartType.UpperLeg_L))); leftUpperLeg:setBleeding(false); getPlayer():getBodyDamage():SetScratched(getPlayer():getBodyDamage():getBodyPart(BodyPartType.Hand_R), false); I have tried both of these functions, but none of them does not work... I need to heal a scratch on the character body and stop the bleeding.
×
×
  • Create New...