Jump to content

random skin


Monty

Recommended Posts

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

Diet with russian vodka, lose 3 days in one week !

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)]) 

Software Engineer & Entrepreneur Running Lustrel and VilarikA • Highly engaged on open source community

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 ) ) 

lol

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.

Software Engineer & Entrepreneur Running Lustrel and VilarikA • Highly engaged on open source community

Posted

Seb:>, haha, don't worry.

-

Monty, and you? Solved your problem?

Software Engineer & Entrepreneur Running Lustrel and VilarikA • Highly engaged on open source community

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...