Non-threaded

Forums » Newbie Central » Read Thread

Introduce yourself and get to know the community.

Automatically giving a player an object?

13 years ago

Hey guys I'm super new to this and working on my first story.  Basically what I want is when a player uses a particular item it turns into a different one.  I already send them to a new page when they use the item and I just want to automatically give them the new item instead of having to pick it up.  How could I go about doing this?

Thanks in advance guys. :D

Automatically giving a player an object?

13 years ago

put the follow in your page script:

%ITEMSTATE## := 1

The ## is the number of you item. If you go to your item list it'll say #1 or #2, etc in front of the item. Numbers generally are in the order you create the item in.

Examples:

%ITEMSTATE1 := 1

%ITEMSTATE4 := 1

%ITEMSTATE12 := 1

If you set it equal to 0, it removes the item from their inventory (assuming they have it, otherwise it does nothing).

You could also put it in the link script if of the link they click to get to that page if you want.

Automatically giving a player an object?

13 years ago

You'll need to enable scripting for this

Automatically giving a player an object?

13 years ago

Hmm, I've put it in the link script and it doesn't seem to be working.  Do I just put it just like that by itself or are there other parts to make the script work?  Also,  I'm not sure how to get to the page script.

Automatically giving a player an object?

13 years ago

It should be working, but link scripts are always weird for me too.

To use the page script, click the button that looks like := beside the title of the page when you open it to edit it.

Automatically giving a player an object?

13 years ago

Yeah I figured that part out, but the script still isnt working there either.  I cant figure out what I'm doing wrong. D:

Automatically giving a player an object?

13 years ago

Well, what exactly did you type into the page script window? If you copy-paste it here, maybe we can spot something that causes it not to work.

Automatically giving a player an object?

13 years ago

Dunno then. Are you sure the number you're using is the number of your item?

Automatically giving a player an object?

13 years ago

Positive. Is there any alternative method to accomplish this?

Automatically giving a player an object?

13 years ago

Nope, this way is the only way we know of.

try changing it to:

$ITEMSTATE

with a dollar sign instead of percent.

Automatically giving a player an object?

13 years ago

Awesome, changing it to $ sign made it work perfectly.  Don't understand why when all the tutorials seem to say %. Ah well, thanks a ton for all the help guys, I love this community already. :D

Automatically giving a player an object?

13 years ago

Yeah, bit odd, but basically any variable YOU make, starts with a % sign, and any one made by the system by default starts with a $ sign.

Automatically giving a player an object?

13 years ago

You should use the item script.

Automatically giving a player an object?

13 years ago

Put the script in the page script instead of the link script. That's how I did something similar in one of my games. :)

Automatically giving a player an object?

13 years ago

When I saw this thread in the forum and your name, I had thought that the title was Automatically giving booze. XD

Automatically giving a player an object?

13 years ago
^^^ Very funny.