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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help please

Previous Thread :: Next Thread 
drco12 is not online. drco12
Joined: 26 Sep 2009
Total Posts: 234
31 Mar 2014 11:55 PM
Can someone help me re-write the random map chooser line so that it does not pick the same map twice? Thank you. :)

while true do
wait(5)
local m = math.random(1,17)
local player = game.Players:GetPlayers()
for i = 2, #player do
msg = Instance.new("Hint")
msg.Parent = nil
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
31 Mar 2014 11:56 PM
wot
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
31 Mar 2014 11:58 PM
It's not random if it can't pick the same map twice, but here:

local maps = {maps...}
local lastMap = 0
local randomMap = 0
repeat randomMap = maps[math.random(#maps)] until randomMap ~= lastMap
lastMap = randomMap

Something like that
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
01 Apr 2014 12:00 AM
Ohh nice.

http://www.roblox.com/Forum/ShowPost.aspx?PostID=129293695
Report Abuse
drco12 is not online. drco12
Joined: 26 Sep 2009
Total Posts: 234
01 Apr 2014 12:16 AM
Does this look right? I attempted it...

local LastMap = ""

function RandomMap()
local m = math.random(1,#Maps)
end

while true do
wait(5)
RandomMap()
if m == LastMap then
RandomMap()
else
local player = game.Players:GetPlayers()
for i = 1, #player do
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Apr 2014 12:24 AM
No

local LastMap = 0
local map = nil

function RandomMap()
m = math.random(1,#Maps)
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Apr 2014 12:25 AM
local m = nil* (not local map = nil)
Report Abuse
drco12 is not online. drco12
Joined: 26 Sep 2009
Total Posts: 234
01 Apr 2014 12:42 AM
Was everything below that ok?
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
01 Apr 2014 12:45 AM
Two questions:
1.) Why did you copy the script from the op in the link provided?
2.) Why are you trying to help if you can`t tell if that simple script that cnt posted has any errors?
Report Abuse
drco12 is not online. drco12
Joined: 26 Sep 2009
Total Posts: 234
01 Apr 2014 12:50 AM
I meant the script I posted... was the rest of it ok below what cnt corrected?
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
01 Apr 2014 12:52 AM
That still doesn`t answer question one. If that`s your alt/main then my new questions is "Why did you make another thread?"
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