Aloha! I am wondering this, what steps must I do?
I have tried
But that did not workCode:player.inventory.GiveItem(ItemManager.CreateByName(itemName), amount, bp);
Item name was "apple"
Amount was int of 1
bp was bool of false
Cheers!
Solved Giving an item to a player? (Js)
Discussion in 'Rust Development' started by Preston 3, Dec 26, 2015.
-
The function you are using doesn't exist with the parameters you are passing in.
Either use this...
Code:public bool GiveItem(Item item, ItemContainer container = null)
Code:public bool GiveItem(int itemid, int amount = 1, bool sendNotification = true)
-
Thanks, that fixed one thing, but do you know what ItemManager is in JS?
-
-
Ah, thanks anyway. It works if I put the itemID in manually. I just need to convert the name to ID now.
Anyone know what ItemManager is under JS?Last edited by a moderator: Dec 26, 2015 -
Calytic Community Admin Community Mod
Code:global.ItemManager.CreateByName(name)
-
Thanks! But I've already migrated to LUA, I finished at 5AM. Thanks for the help though, it should help any others who are using JS.
Cheers