Leveraged
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 11564 |
|
|
| 24 Aug 2015 10:10 PM |
so like
im making a script, that randomly makes certain imagelabels go visible/invisible, and a sound turn on/off with that.
I'm too impatient to wait for this to execute, but would this work?
i = math.random(100,10,30,50,250,300,2) f = math.random(200,250,150,100,50,25) e = math.random(.3,.5,.15,.25) while wait() do local g = script.Parent.BlizzardGui g.Flakes.Visible = false g.Flakes2.Visible = false g.Wind.Volume = e wait(i) g.Flakes.Visible = true g.Wind.Volume = 1 g.Flakes2.Visible = true wait(f) end
I suppose I could use smaller values, but ye
aright aright aright -lord matthew 2015 |
|
|
| Report Abuse |
|
|
gangman67
|
  |
| Joined: 04 Jun 2011 |
| Total Posts: 798 |
|
|
| 24 Aug 2015 10:11 PM |
math.random(2, 300) only use to values it will pick a num 2 - 300 |
|
|
| Report Abuse |
|
|
Leveraged
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 11564 |
|
|
| 24 Aug 2015 10:12 PM |
ya idk how it works
aright aright aright -lord matthew 2015 |
|
|
| Report Abuse |
|
|
Leveraged
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 11564 |
|
|
| 24 Aug 2015 10:12 PM |
ohhh, ty lmao
aright aright aright -lord matthew 2015 |
|
|
| Report Abuse |
|
|
KoreanBBQ
|
  |
| Joined: 06 Mar 2015 |
| Total Posts: 1436 |
|
|
| 24 Aug 2015 10:18 PM |
the math.random takes two arguments: minimum value, and max value, and it then picks a random integer in those boundaries following a seed pattern which can be defined as well
~TreeBranch, Owner of Lady of the Federation x2+ Crown of Roses |
|
|
| Report Abuse |
|
|
Leveraged
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 11564 |
|
|
| 24 Aug 2015 10:19 PM |
This works, but it waits the max amount of time every single time [20].
i = math.random(1,20) f = math.random(1,20) e = math.random(.15,.75) while wait() do local g = script.Parent.BlizzardGui g.Flakes.Visible = false g.Flakes2.Visible = false g.Frost.Visible = false g.LocalScript.Disabled = true g.LocalScript1.Disabled = true script.Parent.Wind.Sound.Volume = e wait(i) g.LocalScript.Disabled = false g.LocalScript1.Disabled = false g.Flakes.Visible = true g.Frost.Visible = true script.Parent.Wind.Sound.Volume = 1 g.Flakes2.Visible = true wait(f) end
Any help?
aright aright aright -lord matthew 2015 |
|
|
| Report Abuse |
|
|
Ooko
|
  |
| Joined: 09 Jun 2008 |
| Total Posts: 11480 |
|
|
| 24 Aug 2015 10:27 PM |
while true do i = math.random(1,20) f = math.random(1,20) e = math.random(.15,.75) while wait() do local g = script.Parent.BlizzardGui g.Flakes.Visible = false g.Flakes2.Visible = false g.Frost.Visible = false g.LocalScript.Disabled = true g.LocalScript1.Disabled = true script.Parent.Wind.Sound.Volume = e wait(i) g.LocalScript.Disabled = false g.LocalScript1.Disabled = false g.Flakes.Visible = true g.Frost.Visible = true script.Parent.Wind.Sound.Volume = 1 g.Flakes2.Visible = true wait(f) end |
|
|
| Report Abuse |
|
|
Ooko
|
  |
| Joined: 09 Jun 2008 |
| Total Posts: 11480 |
|
|
| 24 Aug 2015 10:29 PM |
| The script it only firing once, so each variable is only set once, thus every time the wait(i) command hits, it waits the same amount of time. putting the while true do loop before the variable setting lets the variables be assigned over and over (thought I don't know if you want this to be an endles sound thingy) |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2015 12:03 AM |
while true do i = math.random(100,10,30,50,250,300,2) f = math.random(200,250,150,100,50,25) e = math.random(.3,.5,.15,.25) local g = script.Parent.BlizzardGui g.Flakes.Visible = false g.Flakes2.Visible = false g.Wind.Volume = e wait(i) g.Flakes.Visible = true g.Wind.Volume = 1 g.Flakes2.Visible = true wait(f) end
**** |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2015 01:41 AM |
Lol math.random() only has 2 parameters
math.random(lowest number, highest number)
You like Clash of Clans? Play this developing masterpiece by Domini Studios http://www.roblox.com/games/282763164/Clash-of-Bloxians-Beta Scripted by yours truly |
|
|
| Report Abuse |
|
|
| |
|