Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Using Random Scripting with Items

11 years ago

Is there an article or any tips that I can get with scripting regarding the random variable with items?
I'm trying to make it so that a character gives you 1 of 3 possible items, but when you click the link, the item he gives you is random each time.

Any help would be very much appreciated. Thanks.

Using Random Scripting with Items

11 years ago
%RANDOM := 1D3
 
IF %RANDOM = 1 THEN $ITEMSTATE1 := 1
IF %RANDOM = 2 THEN $ITEMSTATE2 := 1
IF %RANDOM = 3 THEN $ITEMSTATE3 := 1

This essentially uses a random value to set which item should be in the player's inventory. Replace the number after the ITEMSTATE with the number of each item. Advanced scripting needed.

Using Random Scripting with Items

11 years ago

I'm having trouble with this as well. But what page do I put this stuff on?

Using Random Scripting with Items

11 years ago

Um. The page where you want them to get the random item of course.

Using Random Scripting with Items

11 years ago

  Ohhh... I can be quite... dumb seeming at times.