generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Wait... So how do I make this a probability...?

Previous Thread :: Next Thread 
DuskNotes is not online. DuskNotes
Joined: 29 Dec 2013
Total Posts: 1337
29 Jan 2014 08:32 AM
[ Content Deleted ]
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jan 2014 09:45 AM
Wrong forum.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jan 2014 09:46 AM
*Wrong forum section.


BTW: Scripting Helpers.
Report Abuse
Polymorphic is online. Polymorphic
Joined: 15 Dec 2010
Total Posts: 8583
29 Jan 2014 01:06 PM
i personally thnk the best way to do probability is like,

if math.random() <= 0.1 then --10% chance, math.random doesnt go below 0.1 often

you can even go 0.005. smallest i've ever seen math.random get is 0.0000741
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jan 2014 01:17 PM
It can get 0. That's the lowest. It cannot reach 1.
Report Abuse
B00M3RT0M is not online. B00M3RT0M
Joined: 28 Jul 2011
Total Posts: 162
29 Jan 2014 01:59 PM
it acn get negative numbers 2 u no
u kno, negative numbers? that r below 0? yes, them
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jan 2014 02:02 PM
Nope.
Report Abuse
B00M3RT0M is not online. B00M3RT0M
Joined: 28 Jul 2011
Total Posts: 162
29 Jan 2014 02:03 PM
yes. period.
now leave bb
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jan 2014 02:09 PM
Prove it.
Report Abuse
B00M3RT0M is not online. B00M3RT0M
Joined: 28 Jul 2011
Total Posts: 162
29 Jan 2014 02:13 PM
why dont u test it urself? it can return negative numbers, why wouldnt it be able to.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jan 2014 02:15 PM
Because math.random() generates a random integer greater than or equal to 0, but less than 1.
Report Abuse
AndroidKitKat is not online. AndroidKitKat
Joined: 21 Sep 2013
Total Posts: 1525
29 Jan 2014 02:18 PM
^ integer...?

EOS db 0x00 ;End of String Marker
Report Abuse
B00M3RT0M is not online. B00M3RT0M
Joined: 28 Jul 2011
Total Posts: 162
29 Jan 2014 02:20 PM
@kitkat, whats the highly technical term for it then mister assemblymaster

@unkno, thats what u say, and its not true. k
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jan 2014 02:30 PM
@AndroidKitKat: Brain melt. Ignore that word. I never typed it (I didn't! D:)
Report Abuse
B00M3RT0M is not online. B00M3RT0M
Joined: 28 Jul 2011
Total Posts: 162
29 Jan 2014 02:31 PM
oh no u lost so much street cred ppl wont think ur that intelligent and smart anymor.
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
29 Jan 2014 03:15 PM
From the Lua 5.1 reference:

"math.random ([m [, n]])

...

When called without arguments, returns a uniform pseudo-random real number in the range [0,1)."


You just lost all u street kred kid OoHHHhHhhh WHAT A LOSER oOhHhHhhHHh
Report Abuse
AnimatedUglyPet is not online. AnimatedUglyPet
Joined: 23 Feb 2013
Total Posts: 364
29 Jan 2014 03:18 PM
i probably have twice the street cred that all of you have. even more maby .
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
29 Jan 2014 03:27 PM
HOW TO DO A 10% CHANCE!!!

times = 0
for I = 1, 100 do--percent
if math.random(1, 100) > 50 then
times = times + 1
end
end
if times <= 10 then
--drop bow
end
Report Abuse
B00M3RT0M is not online. B00M3RT0M
Joined: 28 Jul 2011
Total Posts: 162
30 Jan 2014 07:50 AM
show-off, get out if ur not gonna do anything else other than bragging
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
30 Jan 2014 04:39 PM
if math.floor(tick() * 100)%10==1 then
print("probability of 10% based on time o3o")
end
Report Abuse
B00M3RT0M is not online. B00M3RT0M
Joined: 28 Jul 2011
Total Posts: 162
31 Jan 2014 03:00 PM
well lookie here, trollbait is showing off once again.
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
31 Jan 2014 04:55 PM
hi troll
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
31 Jan 2014 05:19 PM
@MettaurSp:

But still, why not (math.random() < 0.1)?
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
31 Jan 2014 05:21 PM
Cause I was aiming for a method that doesn't use that out of boredom o3o
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
31 Jan 2014 05:26 PM
(tick()*1) < 0.1

But that feels less random :<
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image