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
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 02 Feb 2015 04:22 PM |
| Not talking to you vach, sorry. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|