Jump to content

Requesting help for function eatItem(cigarettes, 1, 0)


LONIX

Recommended Posts

Hello everybody,

i'm trying to make a mod but still too noob to do that alone.... please help me ^^ !!!

 

This mod essentially remap some key to do specific actions. The action i'm focus in is the smoke action. What i want to do is a function that check if player have all the items needed to smoke a cigarette (cigarette lighter or matches) and then perform eatItem(cigarettes, 1, 0). Would be great if the used items return back on their original containers after the action.

 

Thanks in advance

 

Edited by LONIX
Link to comment
Share on other sites

locate cigarrette: 

 

local cigarette = getPlayer():getInventory():getFirstTypeRecurse("Base.Cigarettes")

if not cigarette then

    return

end

...

 

My recommendation is to look at AutoSmoke mod files for part of what you need

 

You can find the mod files within the steam app by subscribing to the mod

 

for example go to  C:\Program Files (x86)\Steam\steamapps\workshop\content\

 

And then searching for the modname with the searchbar ("AutoSmoke")

 

https://steamcommunity.com/sharedfiles/filedetails/?id=264375187

Edited by azrathud
Link to comment
Share on other sites

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...