|
| 01 Feb 2017 07:59 PM |
local replicatedStorage = game:GetService("ReplicatedStorage") local maps = replicatedStorage:WaitForChild("Maps") function pickMap() local mapList = maps:GetChildren() -- Declares a table of the maps inside of the Maps folder. local selectedIndex = math.random(1,#maps) -- Choose a random number between 1, and the number of maps available. local map = mapList[selectedIndex]:Clone() -- Create a clone of the map we selected. map.Parent = workspace -- Parent it to the workspace. map.Name = "Map" -- Rename the map so that we can use the unloadMap() function later to remove it. return mapList[selectedIndex].Name -- Return the name of the map we selected, in case we want to display it. end function unloadMap() if workspace:FindFirstChild("Map") then -- If there is a model in the Workspace named "Map" workspace.Map:Destroy() -- Destroy it! end end local h = Instance.new("Hint") h.Parent = workspace while true do h.Text = "Picking new map..." wait(3) local mapName = selectMap() h.Text = "Selected map: "..mapName wait(3) h.Text = "Unloading map..." unloadMap() wait(3) end
-----------------------------------------------------
i put this in a local script - but where do i put it in my game so it will actually pick a map i have in my map folder
note: this is a script on the wiki page - im using it til i am fluent in scripting (starting to learn)
-zaxzacnv1 |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Feb 2017 08:04 PM |
Server script services?
Love breeds sacrifice... which in turn breeds hatred. Then you can know pain. |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2017 08:06 PM |
@Light - It didn't work?
I have all my maps in a folder named "maps"
and then 2 maps in that folder - each having their own custom name?
-zaxzacnv1 |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2017 08:09 PM |
Huh idk then, I put all my script there and it works just fine...
Love breeds sacrifice... which in turn breeds hatred. Then you can know pain. |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2017 08:16 PM |
I mean this one wants to pull a map out of replicated storage - then delete it once the round is over - but i cant get it to work :(
-zaxzacnv1 |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 01 Feb 2017 09:03 PM |
Try putting this at the top of your script:
setfenv(1, {})
That outa do it |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2017 09:18 PM |
@Dark, under which thing should I put it under?
like the script itself do i put it in workspace or???
-zaxzacnv1 |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2017 09:22 PM |
| ignore dark, he's trying to be a funny troll |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Wrathoxic
|
  |
| Joined: 29 May 2013 |
| Total Posts: 1950 |
|
|
| 02 Feb 2017 05:45 AM |
local replicatedStorage = game:GetService("ReplicatedStorage") local maps = game.ServerStorage:WaitForChild("Maps") function pickMap() local mapList = maps:GetChildren() -- Declares a table of the maps inside of the Maps folder. local selectedIndex = math.random(1,#maps) -- Choose a random number between 1, and the number of maps available. local map = mapList[selectedIndex]:Clone() -- Create a clone of the map we selected. map.Parent = workspace -- Parent it to the workspace. map.Name = "Map" -- Rename the map so that we can use the unloadMap() function later to remove it. return mapList[selectedIndex].Name -- Return the name of the map we selected, in case we want to display it. end function unloadMap() if workspace:FindFirstChild("Map") then -- If there is a model in the Workspace named "Map" workspace.Map:Destroy() -- Destroy it! end end local h = Instance.new("Hint") h.Parent = workspace while true do h.Text = "Picking new map..." wait(3) local mapName = selectMap() h.Text = "Selected map: "..mapName wait(3) h.Text = "Unloading map..." unloadMap() wait(3) end
Put this script in ServerScriptService, the maps folder in ServerStorage.
|
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 02 Feb 2017 05:47 AM |
You are calling a function that does not exist.
Change selectmap() to pickmap() |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2017 07:19 PM |
Still confused...
-zaxzacnv1 |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 06 Feb 2017 07:22 PM |
| put it in the trash with all the free models |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2017 07:28 PM |
| @XCVIII, What free models? Did you even visit the game? The only thing that's # free model is the couch and stuff in the shop. that aint staying i just needed something to fill the space to remind me what i was putting there lmao -zaxzacnv1 |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 06 Feb 2017 07:35 PM |
If you want to learn how to make a minigame then go here and click on the "edit" button.
https://www.roblox.com/games/141589692/Basic-Minigame
|
|
|
| Report Abuse |
|
|
|
| 06 Feb 2017 07:37 PM |
Thanks @TimeTicks
-zaxzacnv1 |
|
|
| Report Abuse |
|
|