08-23-2011, 00:28
(This post was last modified: 08-23-2011, 00:29 by Tomsen1410.)
Hey,
i have a function which will give 8 Variables with a random amount.
But, how can i code, that every Variable has a diffrent amount? So if var1 and var5 is same it should make as long random amounts for var5 till its not the same like var1?
Code:
Here ive tried to solve it, but doesnt work :/
Help pls
i have a function which will give 8 Variables with a random amount.
But, how can i code, that every Variable has a diffrent amount? So if var1 and var5 is same it should make as long random amounts for var5 till its not the same like var1?
Code:
Code:
for(i = 1; i <= 8; i++)
{
level.WepPartSpawning[i] = randomInt(level.WepPartSpawnNumber)+1;
}Here ive tried to solve it, but doesnt work :/
Code:
for(i = 1; i <= 8; i++)
{
level.WepPartSpawning[i] = randomInt(level.WepPartSpawnNumber)+1;
for(r = 1; r <= 8; r++)
{
if(isDefined(level.WepPartSpawning[r]) && level.WepPartSpawning[i] == level.WepPartSpawning[r] && i != r)
level.WepPartSpawning[i] = randomInt(level.WepPartSpawnNumber)+1; continue;
}
}Help pls


