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 » Scripting Helpers
Home Search
 

Re: mathrandom fail, picks same number.

Previous Thread :: Next Thread 
1Ra is not online. 1Ra
Joined: 02 May 2010
Total Posts: 2400
22 Aug 2011 01:41 PM
math.randomseed(tick())

mat = math.random(1,4)
if mat == 1 then y:MoveTo(29, 23.1, 4)
elseif mat == 2 then y:MoveTo(37, 22.9, 75)
elseif mat == 3 then y:MoveTo(-63, 23.1, 62)
elseif mat == 4 then y:MoveTo(-86, 22.9, 29)
end
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
22 Aug 2011 01:43 PM
It picks the same number every time? Really?
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
22 Aug 2011 01:44 PM
No, that's because you set a variable to it once. The variable doesn't change.

[Now son, don't touch that cactus]
Report Abuse
1Ra is not online. 1Ra
Joined: 02 May 2010
Total Posts: 2400
22 Aug 2011 01:44 PM
yes. i have it in 2 for loops could that be the problem?

i only gave a snnipet of the code.
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
22 Aug 2011 01:45 PM
Post the entire script.

[Now son, don't touch that cactus]
Report Abuse
DigitalRunner is not online. DigitalRunner
Joined: 07 Aug 2011
Total Posts: 193
22 Aug 2011 01:47 PM
@Mega you got your account back :D I'm getting mine tomorrow :D
Report Abuse
1Ra is not online. 1Ra
Joined: 02 May 2010
Total Posts: 2400
22 Aug 2011 01:48 PM
function A1()
local v = game.Lighting.Zombie
for i = 1, script.Plyrcount.Value*2 do
y = v:clone()
y.Parent = game.Workspace.Backpack
y:MakeJoints()
mat = math.random(1,4)
if mat == 1 then y:MoveTo(29, 23.1, 4)
elseif mat == 2 then y:MoveTo(37, 22.9, 75)
elseif mat == 3 then y:MoveTo(-63, 23.1, 62)
elseif mat == 4 then y:MoveTo(-86, 22.9, 29)
end
y:MakeJoints()
wait(.5)
end
end


--later in the script (its like 500 lines of code total D:)

for i=1,3 do

A1()

wait(20)
end
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
22 Aug 2011 01:50 PM
@Ratex


I got my main back, but not my name snipes. :c

Thanks for noticing.

@1Ra

I have no idea what the problem could be.

[Now son, don't touch that cactus]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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