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: Help with game?

Previous Thread :: Next Thread 
TheWisest is not online. TheWisest
Joined: 11 Nov 2010
Total Posts: 7345
07 Feb 2012 01:02 PM
So I'm making a scavenger hunt game, and I need a little help with a script.
(THIS IS NOT A REQUEST!)

So I have this script that randomly chooses a map out of a model in lighting called 'Maps', but I don't really how to make it randomly choose just one map at a time...

Here's what I have so far:

Maps = game.Lighting.Maps

PlayTime = 120

LobbyTime = 15

MapName = Instance.new("Message")

MapName.Parent = nil

---------------------------
while true do
wait(LobbyTime)
for i,v inpairs(Maps) do
v:GetChildren()
---------------------------

Thanks. :)

~TheWisest~
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
07 Feb 2012 01:04 PM
local map = game.Lighting,Maps:GetChildren()
map[math.random(1,#map)]:Clone().Parent = Workspace

that should work.

~I script Awesome sauce to go with my spaghetti code
Report Abuse
TheWisest is not online. TheWisest
Joined: 11 Nov 2010
Total Posts: 7345
07 Feb 2012 01:06 PM
I'll test it, thanks.

~TheWisest~
Report Abuse
TheWisest is not online. TheWisest
Joined: 11 Nov 2010
Total Posts: 7345
07 Feb 2012 01:14 PM
That worked! Thanks a ton! :D

~TheWisest~
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