Servuo: Trying to add items to new characters pack

Blitzman

Citizen
Operating System
Windows 10
ServUO Version
0.0
I appologize, but I've searched and can't find any answers that work for me. I'm trying to add items from a script I found in the resources section to new characters pack, but I keep getting an error.

View attachment 17939

This is the section I am trying to add it to:

private static void AddBackpack(Mobile m)
{
Container pack = m.Backpack;
if (pack == null)
{
pack = new Backpack
{
Movable = false
};
m.AddItem(pack);
}
PackItem(new Gold(1000)); // Starting gold can be customized here
PackItem(goldbag());
PackItem(lootbag());
}

Any help is very much appreciated.
Post automatically merged:

I should add that I'm using pub 57.
 
Last edited:

Hammerhand

Rookie
Check the goldbag & lootbag scripts to see exactly how they are spelled. Are they spelled completely in lower case or are there upper case letters as well? They need to be added in with the same spelling. Or you could also try adding the word new before them like it has for Gold. Or maybe even both.
 

Blitzman

Citizen
Check the goldbag & lootbag scripts to see exactly how they are spelled. Are they spelled completely in lower case or are there upper case letters as well? They need to be added in with the same spelling. Or you could also try adding the word new before them like it has for Gold. Or maybe even both.
I tried just as you suggested. I tried both. I still get an error for them but it has changed to this:

1619730530598.png
 

Milva

Moderator
You have 2 posts for the exact same thing :) At the very top of the script may need to add exactly how the lootbag and other one are found in your scripts.
 
Which one are you using? I know of at least two. Also like Hammerhand said, try it like..

PackItem(new GoldBag());
PackItem(new Lootbag());
 
Last edited:

Blitzman

Citizen
You have 2 posts for the exact same thing :) At the very top of the script may need to add exactly how the lootbag and other one are found in your scripts.
Yeah...:confused: I made the first post in the wrong area and couldn't figure out how to delete it. I'm sorry.
Post automatically merged:

Which one are you using? I know of at least two. Also like Hammerhand said, try it like..

PackItem(new GoldBag());
PackItem(new Lootbag());
I tried them all, but the one you and Hammerhand mention gave me the least errors.

1619736019790.png
 

Blitzman

Citizen
Problem solved:

I didn't have the using directive. Once I added that it works beautifully! Thank you Lokai who found my other post, moved it and also replied with that advice. Thank you all for your help!