ID:179857
 
I want it so on Login there is a a 30% chance that someone would be a King Rathre than a Knight
Can Someone Tell me how


thanks
CloneGoku
comeon someone i need t know please
In response to CloneGoku
CloneGoku wrote:
comeon someone i need t know please



Replying to your own post in less then a hour won't help your question be answered.
In response to Nadrew
well i needed it fast, i wanted to get it done can you help ?
In response to Nadrew
Look up rand(), dice(), and prob() with F1 or the reference. I cant remember if the FAQ has an entry about it, but try to look anyways

Alathon
In response to Alathon
i look up prob(), which is what i needed,it didnt really help i need an example using icons

In response to CloneGoku
Heres an example with rand()

mob/verb/Change_Random(ran as num, ranover as num)
if(rand(ran) > ranover)
icon = 'Booya_You_Passed.dmi'
else
icon = 'Awwwwwww.dmi'

Alathon
In response to Alathon
i dont want rand, i want prob
In response to CloneGoku
.....

if(prob(25))
icon = 'lalala.dmi'
else if(prob(50))
icon = 'lalalalalala.dmi'

Havent used prob() yet but I think thats how its used

Alathon
In response to Alathon
thanks
In response to Alathon
i couldnt get it to work like that
In response to CloneGoku
Sigh...Do you need it handfed? There are LOTS of ways to do it, and Ive given you info on all of them. If you dont understand them, read the FAQ, and the guide. Those proc's are very simple to use.

var/lala = rand(1,10)
switch(lala)
if(1)
// lala

var/rand_prob = prob(rand(1,100))
if(rand_prob <= 25)
// whatever
else if(rand_prob <= 50)
// ...you get it

Alathon
In response to Alathon
Well, Sorry if it came up with a bunch of errors with the one you told me
In response to CloneGoku
Well you werent supposed to copy paste! *Sighs again*

Alathon
In response to Alathon
who said i did that i never did
In response to CloneGoku
CloneGoku wrote:
who said i did that i never did

You weren't supposed to copy it as written either. You should spend more time learning the basics.
In response to Spuzzum
That tutorial never mentioned anything about prob()
In response to CloneGoku
CloneGoku wrote:
That tutorial never mentioned anything about prob()

I was referring more to your code layout in general. You always need to put things into procs belonging to the appropriate objects.