View Full Version : How do I assign a random integer for a specific object?

06-20-2012, 05:16 PM
I'm new-ish to Javascript, and I'm currently renovating a Team Fortress 2 Crafting Game which is Javascript based.

What I'm trying to do is to have the item's description and level show up on the right-hand side of the screen. For hats, the level needs to be random. Problem is, the random level I assign either changes when I hover over the hat or it stays the same for that hat and every other.

My question is: how would I set the random integer for that instance of the hat, and no other?

(if this is worded incorrectly, or there is something you do not understand, please post it)

Here is the game so far:
Game (https://dl.dropbox.com/u/17887537/Crafting%20Game/craftinggame.htm)
Rar'd files (https://dl.dropbox.com/u/17887537/Crafting%20Game.rar)