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: Is this a good way to change maps?

Previous Thread :: Next Thread 
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Feb 2015 04:10 PM
This is the first time I've tried this, so this is just a test, but if I do it this way will this be good to depend on?

while true do
wait (20)
game.ServerStorage.Crossroads.Parent = game.workspace
game.Players.LocalPlayer.PlayerGui.MainGui.Map.Text = ("This map is Crossroads.")
wait (30)
game.workspace.Crossroads.Parent = game.ServerStorage
game.Players.LocalPlayer.PlayerGui.MainGui.Map.Text = ("The round is over!")
end
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Feb 2015 04:14 PM
This went down fast.
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
02 Feb 2015 04:19 PM
Use a function and set some initial variables such as the Map's name, and the Map's duration.

local function ChangeMap( name, duration )
local ServerStorage=game.ServerStorage
if ServerStorage:FindFirstChild( name )then
local Map=ServerStorage[ name ]
Map.Parent=Workspace
local Hint=Instance.new('Hint',workspace)
Hint.Text= (' This map is '.. name )
wait( duration )
Map.Parent=ServerStorage
end
end

ChangeMap( 'Crossroads', 30 )
Report Abuse
vacharya is not online. vacharya
Joined: 06 Jan 2011
Total Posts: 511
02 Feb 2015 04:21 PM
No, you are referring for a local player (I'm assuiming this is a local script) and it will load the map for every player.
Also local scripts can't access ServerStorage.

So I would suggest making a value in Replicated Storage and under announcement label, add something to make the label's text to the message everytime the value has changed.

game.ReplicatedStorage.Value.Changed:connect(function()
script.Parent.Text = tostring(game.ReplicatedStorage.Value)
end)

* Map cloning, try cloning the map into workspace instead of just changing it's parent, this will make sure the original map is cloned into the workspace everytime.

so
map = game.ServerStorage.Map --Remember Local scripts can't access ServerStorage so this would have to be in a "Script" either in workspace
newmap = map:Clone()
newmap.Parent = game.Workspace.CurrentMap
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Feb 2015 04:21 PM
That's pretty much exactly the same but with a lot of other stuff I don't see the need in adding. Explain why I need that stuff, please.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Feb 2015 04:22 PM
Not talking to you vach, sorry.
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
02 Feb 2015 04:23 PM
It'd be an easier way to change your maps, within a function.

But Vach is correct, you're using a Localscript which will replicate X amount of maps for the X amount of players in the server.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Feb 2015 04:23 PM
@vach
Would while true do still be in there? Or would that mess it up?
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Feb 2015 04:24 PM
Oh, this was in a normal script, I noticed the game.Players.LocalPlayer thing already.
Report Abuse
vacharya is not online. vacharya
Joined: 06 Jan 2011
Total Posts: 511
02 Feb 2015 04:52 PM
Yes, if you are making a game with rounds or just want fresh maps every so often then you could use while loops.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Feb 2015 04:53 PM
@vach
www.roblox.com/Forum/ShowPost.aspx?PostID=155209868
Report Abuse
vacharya is not online. vacharya
Joined: 06 Jan 2011
Total Posts: 511
02 Feb 2015 04:59 PM
qq
Well I just told you a very basic way of doing it.. idk if I'm supposed to be offended..
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