Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Map Chooser script not working saying that selectMap() needs to be defined??

Asked by 8 years ago

I'm trying to make a map chooser for the minigame server I'm making and it says that the selectMap() at line 24 needs to be defined. I don't know what to do?!??!?

01local replicatedStorage = game:GetService("ReplicatedStorage")
02local maps = replicatedStorage:WaitForChild("Maps")
03 
04function pickMap()
05    local mapList = maps:GetChildren()
06    local selectedIndex = math.random(1,#maps) -- Choose a random number between 1, and the number of maps available.
07    local map = mapList[selectedIndex]:Clone() -- Create a clone of the map we selected.
08    map.Parent = workspace -- Parent it to the workspace.
09    map.Name = "Map" -- Rename the map so that we can use the unloadMap() function later to remove it.
10    return mapList[selectedIndex].Name -- Return the name of the map we selected, in case we want to display it.
11end
12 
13function unloadMap()
14    if workspace:FindFirstChild("Map") then
15        workspace.Map:Destroy()
View all 30 lines...

1 answer

Log in to vote
4
Answered by
Asigkem 32
8 years ago

Surely it's because your function is actually called pickMap()

0
1 sec TakenGoomig 0 — 8y
0
Lol Perci1 4988 — 8y
0
Didn't work selectMap is post to sat the name of the map that has been picked. TakenGoomig 0 — 8y
0
*say TakenGoomig 0 — 8y
View all comments (5 more)
1
@Goomig But selectMap doesn't exist. Read your own code xD Perci1 4988 — 8y
0
Dang. People always snagging the easy ones. User#11440 120 — 8y
0
What am I post to do? I'm new to scripting... TakenGoomig 0 — 8y
0
On line 24, change selectMap() to pickMap(). This probably isn't even your script. If you want to understand scripting, make the scripts yourself. User#11440 120 — 8y
0
I learned this script from ROBLOX, thank you very much... TakenGoomig 0 — 8y
Ad

Answer this question