Jump to content

Recommended Posts

I wanted to give the player an item after firing a ranged weapon, but when I tried copying the code from another one of my mods (Which game the player an item after they eat a food) it crashes. I think it has something to do with defining who is receiving the item.
Can somebody explain to me how it works?


Any help would be greatly appreciated!
 

	__________.components.inventory:GiveItem(SpawnPrefab("prefab_name"))

--blank space represents where I need help at, I need to know how to correctly define this part in multiple situations.

 

Well, I messed around with the code and managed to get it (sort-of) working.
It is a bit finnicky but I now know just look for the variables set by the game's functions. Building new variables is still out of my range. :-?

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