|
| 26 Sep 2014 09:02 PM |
Recently, I scripted a working RaidCode for a war-clan. (For those that understand C&G terminology)
Well, for some reason, ROBLOX doesn't seem to understand what "random" means, and the same number continues to pop-up, even in different servers for math.random sequence. Here's how I have it set up.
RaidCode = math.random(1,100) if TimeHeld.Value == ## and OwningTeam.Value == BrickColor.new("Medium stone grey") then Instance.new("Message", game.Workspace).Text = "The raiders have won. Good game! Raid Code: "..RaidCode
The best example is right now, I changed it to 1,100 and no matter what, it comes up with 36.
Any ideas as to why?
Trouble w/ Exploiters At Your Base? Having Issues With Your LinkedSword? Use This Sword & Script Provided by The Sword Clan Community: http://www.roblox.com/---item?id=179203012 - Cubyfan2 & Cubyfan22 | Add 23,481 Posts |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Sep 2014 09:10 PM |
I'm pretty sure you have to add 2 dots after Cuby.
local RaidCode = math.random(1, 100) if TimeHeld.Value == 600 and OwningTeam.Value == BrickColor.new("Medium stone grey") then Instance.new("Message", game.Workspace).Text = "The raiders have won. Good game! Raid Code: " .. RaidCode .. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2014 09:11 PM |
I'll give that a go.
Trouble w/ Exploiters At Your Base? Having Issues With Your LinkedSword? Use This Sword & Script Provided by The Sword Clan Community: http://www.roblox.com/---item?id=179203012 - Cubyfan2 & Cubyfan22 | Add 23,481 Posts |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Sep 2014 09:12 PM |
Disregard my current post
I think the problem may be
BrickColor.new("Medium stone grey")
I think it's just
"Medium stone grey" |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2014 09:13 PM |
Didn't work, it just broke the ending message all together.
Trouble w/ Exploiters At Your Base? Having Issues With Your LinkedSword? Use This Sword & Script Provided by The Sword Clan Community: http://www.roblox.com/---item?id=179203012 - Cubyfan2 & Cubyfan22 | Add 23,481 Posts |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2014 09:15 PM |
That whole part is working, the problem is the math.random function doesn't want to randomize the number.
Trouble w/ Exploiters At Your Base? Having Issues With Your LinkedSword? Use This Sword & Script Provided by The Sword Clan Community: http://www.roblox.com/---item?id=179203012 - Cubyfan2 & Cubyfan22 | Add 23,481 Posts |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Sep 2014 09:16 PM |
Well, I have no idea.
You could always try to write out the actual variable. |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 26 Sep 2014 10:33 PM |
Yeah the math.random isn't random like anything. Technically nothing is random (watch Vsauce on it)
BUT
What you could do is make a code that doesn't allow two numbers to be chosen in a row something like:
repeat wait() RaidCode = math.random(1,100) until RaidCode =~ LastRaidCode
Or whatever. So it is less random but seemingly more random? You can also set the randomseed differently but that seems not to work.
|
|
|
| Report Abuse |
|
|