Jump to content

random skin


Monty

Recommended Posts

Posted

i alway use the code

setElementModel(source, ID) 

is possible to specify some IDs and and say to get one of the accidentaly???

Posted

like if he desides that he will have random skins

like 1, 67, 100, 123, 213...

that will chose the random of them

i think

Posted

Do you wanna set a random skin to a certain element? If yes, you can create a table containing all available skins:

mySkins = { 111, 67, 1, 100, 10, 213 } --Create a table with available skins 

Later, use math.random() to get a random number and insert to mySkins[random_number]:

mySkins = { 111, 67, 1, 100, 10, 213 } 
setElementModel(theElement, mySkins[math.random(1, #mySkins)]) 

Posted

StanleySathler: There is an easier way to do this. We'll still use math.random but we wont take ID's from a table we'll just pick a random ID from 1 - 288

setElementModel ( yourElement, math.random ( 1, 288 ) ) 

Posted

@Seb, yes, I agree with you. But we need remember: between 1 and 288, there's some ID numbers that not exist. An example is the ID 8. Oh, and if he wanna set a specific group skin, maybe he must use a table. :P

One love bro,

Sathler.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...