I keep getting that error... it doesn't like the 1 on var testspawn = ItemManager.CreateByItemID(testids[rnd], 1, testskins[rnd]);
But I need it for amount. Does anyone have any idea how to fix it? Been spending several hours trying to figure it out to no avail. Thanks. :)
But I need it for amount. Does anyone have any idea how to fix it? Been spending several hours trying to figure it out to no avail. Thanks. :)
using UnityEngine;
using System.Collections.Generic;
namespace Oxide.Plugins
{
[Info("Test", "me", 0.1)]
[Description("test")]
class Test : RustPlugin
{
void OnEntitySpawned(BaseEntity entity)
{
if (entity is NPCPlayerCorpse) {
PlayerCorpse corpse = entity.GetComponent<PlayerCorpse>();
{
var rnd = Random.Range(0, testids.Count);
var testspawn = ItemManager.CreateByItemID(testids[rnd], 1, testskins[rnd]);
timer.Once(0.5f, () =>
{
testspawn.MoveToContainer(corpse.containers[0]);
});
}
}
}
List<int> testids = new List<int>
{
-1211618504,
106433500,
-1397343301,
-46188931,
115739308,
2107229499
};
List<int> testskins = new List<int>
{
889718910,
889714798,
10058,
889712013,
1106600389,
920390242
};
}
}