Script to limit players inventory doesn't work [solved]

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Script to limit players inventory doesn't work [solved]

Postby Mystery » Mon Feb 20, 2006 3:23 am

I used the script from the AM Help to limit the players inventory and replaced only the number and name of item:

If VAR1 < 6 Then
Action.AddItem "Dollar"
VAR1 = VAR1 + 1
Else
Message "You cannot carry more than 6 items." + VbCrLf + "Throw the items that you don't need into the bin."
End If

The message comes to the right time (and keeps on coming everytime I pick up an item) but I can still collect items to infinity...
Did I miss something?
Last edited by Mystery on Wed Feb 22, 2006 3:45 pm, edited 1 time in total.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby ShadowHunter » Mon Feb 20, 2006 11:35 am

Hi,

You probably have the "add item" still enabled on the hotspot in the GUI.

Make sure "VAR1" is a global variable.

Kind regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Mystery » Mon Feb 20, 2006 1:49 pm

Thank you for your answer ShadowHunter.
I checked and VAR1 is defined as a global variable. And I checked every item hotspot again but I had really disabled "When the hotspot is clicked, add an item to the inventory" at the item area.

Oh, just as I'm writing my answer and thinking about other possibilities, I realize that the player can pick up more than one dollar bills (which have the same name...). Really dumb! I should give them different names and the script should work then (I hope so).
Now you can tell me that this was a typical error of a beginner , yes it seems so... But I learnt it for the future :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron