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 » Scripters
Home Search
 

Re: Random map regen

Previous Thread :: Next Thread 
SPARTAN12334 is not online. SPARTAN12334
Joined: 08 Sep 2013
Total Posts: 34
28 Oct 2015 11:14 AM
Hey Its SPARTAN12334
does anyone out there now how to make/or have a regen script

What im trying to say is I have a game that you can destroy buildings and over a time they regen but not the same map. I would like to have a different map each time it regens plz reply back it will be a big helper for a game.




It might be on the front page in the future


Sincerely to anyone out there with a helpful reply,
SPARTAN12334
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
28 Oct 2015 11:15 AM
math.random()
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
28 Oct 2015 11:18 AM
get a table of all the available maps
choose a map randomly from the table with math.random
clone the random map into workspace
Report Abuse
SPARTAN12334 is not online. SPARTAN12334
Joined: 08 Sep 2013
Total Posts: 34
28 Oct 2015 11:22 AM
have you done a random map regen script before if so send me a message with the script in it, if so thank you
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
28 Oct 2015 11:22 AM
lol get out @OP
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
28 Oct 2015 11:23 AM
"skropt game pls wil pay big mone"
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
28 Oct 2015 11:23 AM
Random maps?

math.noise()



Regen?

Just use a for loop and iterate through the broken parts and then slowly make them become less transparent till their solid?
Report Abuse
Rellica is not online. Rellica
Joined: 11 May 2013
Total Posts: 955
28 Oct 2015 11:24 AM
local maps = game.Lighting.Maps:GetChildren()
local selected_map = maps[math.random(1,#maps)]
selected_map:Clone()

selected_map is the Model that was picked randomly out of "Maps" in Lighting.
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
28 Oct 2015 11:27 AM
big pet peeve anyone who knows a little bit about FE:

don't use lighting to store important crap like maps/weapons.

pls

use ServerStorage
Report Abuse
SPARTAN12334 is not online. SPARTAN12334
Joined: 08 Sep 2013
Total Posts: 34
28 Oct 2015 11:31 AM
I was thinking something like this?: (I don't know that much about scripting)

model.remove() -the current model
model.math(numbers) clone.model()-the chosen model
something like that reply back if ya want
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
28 Oct 2015 11:33 AM
local maps = game.ServerStorage.Maps:GetChildren()

local map = maps[math.random(1,#maps)
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
28 Oct 2015 11:36 AM
i don't want to be that guy but

http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting

you really need it

also if you want to call a method with the . syntax instead of :, you need to do this for example:

local clone = yourModel.Clone(yourModel)
if i remember correctly
Report Abuse
dearjournal is not online. dearjournal
Joined: 04 Nov 2012
Total Posts: 2289
28 Oct 2015 11:52 AM
^^this^^

it's annoying to have people posting wanting us to send them ready made scripts.

Scripters forum isn't your personal little army of scripters. learn how to script and come here when you actually have an issue (yeah ik it isn't script helpers but whatever), and don't just come here to expect Scripters posters to just hand you scripts.
Report Abuse
SPARTAN12334 is not online. SPARTAN12334
Joined: 08 Sep 2013
Total Posts: 34
28 Oct 2015 12:03 PM
Go post your argument on another thread
Report Abuse
dearjournal is not online. dearjournal
Joined: 04 Nov 2012
Total Posts: 2289
28 Oct 2015 12:04 PM
No.
Report Abuse
BigThunderBoy is not online. BigThunderBoy
Joined: 23 Jun 2012
Total Posts: 125
28 Oct 2015 12:21 PM
Generate fresh random numbers by using this line math.randomseed(tick())
Report Abuse
SPARTAN12334 is not online. SPARTAN12334
Joined: 08 Sep 2013
Total Posts: 34
28 Oct 2015 12:26 PM
here is what I came up with:
while true do
local msg = Instance.new("Its time for a new map :D")
local map1 = game.Lighting["Map1"]
local map2 = game.Lighting["Map2"]
local rand = math.random(1,2)
if rand == 1 then
local mc = map1:clone("Map1")
mc.Parent = game.Workspace
msg.Parent = game.Workspace
msg.Text = "Office and Truss have been chosen"
wait(3)
msg.parent = nil
wait(180)
mc:remove("Map1")
elseif rand == 2 then
local mc = map1:clone("Map2")
mc.Parent = game.Workspace
msg.Parent = game.Workspace
msg.Text = "Twin Doomspire has been chosen"
wait(3)
msg.parent = nil
wait(180)
mc:remove("Map2")

end
end
it doesn't seem to work. I have 2 maps in there I also put the maps in lighting is that bad or good?
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
28 Oct 2015 12:33 PM
:remove()

I'm done
Report Abuse
SilentSippycup is not online. SilentSippycup
Joined: 22 Apr 2012
Total Posts: 1168
28 Oct 2015 12:35 PM
why did you put something in the parentheses of :remove() ? i dont think youve ever scripted before
Report Abuse
SectionOne is not online. SectionOne
Joined: 12 Mar 2010
Total Posts: 3783
28 Oct 2015 12:36 PM
No one will make a script for you here...

Go learn the whole scripting through wiki, sloth.
Report Abuse
SilentSippycup is not online. SilentSippycup
Joined: 22 Apr 2012
Total Posts: 1168
28 Oct 2015 12:36 PM
and :clone()
Report Abuse
SPARTAN12334 is not online. SPARTAN12334
Joined: 08 Sep 2013
Total Posts: 34
28 Oct 2015 12:44 PM
this is my fourth attempt to scripting, I've been trying so hard but it didn't seem to work. I will fix it
Report Abuse
SectionOne is not online. SectionOne
Joined: 12 Mar 2010
Total Posts: 3783
28 Oct 2015 12:48 PM
Here's your way to getting better and not being crap:

http://wiki.roblox.com/index.php?title=AllTutorials
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
28 Oct 2015 01:01 PM
put a folder inside of ServerStorage named Maps
put your maps inside of the Maps folder

randomly pick a map from your maps folder like so:

local ss = game:GetService("ServerStorage")
local maps = ss:WaitForChild("Maps"):GetChildren()
local randMap = maps[math.random(1, #maps)]

Instance.new("Message", workspace).Text = "New map is: "..randMap.Name)
Report Abuse
SPARTAN12334 is not online. SPARTAN12334
Joined: 08 Sep 2013
Total Posts: 34
28 Oct 2015 01:19 PM
this is what I have so far
while true do
local ss = game:GetService("ServerStorage")
local maps = ss:WaitForChild("Maps"):GetChildren()
local randMap = maps[math.random(1,2)]
if rand == 1 then
Instance.new("Regen", workspace).Text = "New map is:Map1 "..randMap.Map1)
local mc = Map1:clone()
mc.Parent = game.Workspace
msg.Parent = game.Workspace
wait(3)
msg.parent = nil
wait(10)
mc:remove()
elseif rand == 2 then
Instance.new("Regen", workspace).Text = "New map is:Map2 "..randMap.Map2)
local mc = Map2:clone()
mc.Parent = game.Workspace
msg.Parent = game.Workspace
wait(3)
msg.parent = nil
wait(10)
mc:remove()

end
end

I added the first 3 lines of code you required for me but I didn't know where to add the code lines of Instance so I tried.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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