Jump to content

[Solved]Equipping items because of a profession/occupation issue


fritozy101

Recommended Posts

Attempt/jokes
------------------------------------------------------------------------------------- 
  OnNewGame = function(player, square, profession)
        local player = getPlayer()
        local hat = player:getInventory():AddItem("Base.Hat_Fireman")
        local profession = player.getProfession('fireofficer')
        if not profession then return end
        setClothingItem_Head(hat)
    end,


Working/ish        Having Vest/TorsoExtra/Trousers/Pants/Jacket/LongJacket <-none of that seems to work as IDs, 
->only Head/Hat/Hands/Torso work.   I'm assuming Head = Mask and Hat=Hat
-------------------------------------------------------------------------------------
    OnNewGame = function(player, square, profession)
    local player = getPlayer()
    local hat = player:getInventory():AddItem("Base.Hat_HardHat")
    local vest = player:getInventory():AddItem("Base.Vest_HighViz")
    local gloves = player:getInventory():AddItem("Base.Gloves_LeatherGloves")
    player:setClothingItem_Head(hat)
    player:setClothingItem_Torso(vest)
    player:setClothingItem_Hands(gloves)
    end,

 

 

Final Edit:

Think this is about as far as the thought is willing to go, I ultimately was able to add clothes based on a profession chosen and now have a new issue that I may make a new thread for if that issue also takes more than a week to solve.

 

Been posting junk for some days here, help or not it's keeping me organized and learning, deleted all of the other stuff posted here from my learning curve to not confuse anyone willing to help

(also I think this forum has some less than comprehensive formatting rules) cant even get lines of code to work on the forum.

 

So above is finally doing something... I end up with two Fireman hats in the inventory and the player isn't wearing a fucking thing still:lol:

But it's the closest I've come to calling on a profession and getting the player to wear an item because of it.

 

Utilizing this awesome framework that really helped me make wanted personal game adjustments, as well as come this far. Framework -THANK YOU-

 

Again, any help or pointers appreciated, thank you in advance.

 

 

 

Edited by fritozy101
Link to comment
Share on other sites

  • fritozy101 changed the title to [Solved]Equipping items because of a profession/occupation issue

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...