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

Why my random map choose script not working?

Asked by 6 years ago

I think i am correct but what is the wrong?

local ChoosenMap2 = game:GetService("ReplicatedStorage").Values:WaitForChild("ChoosenMap").Value

game:GetService("ServerStorage"):WaitForChild("Maps")(ChoosenMap2):Clone().Parent = game:GetService("Workspace")
20:54:42.495 - Spleef is not a valid member of Folder
0
Give more details please Carforlife1 59 — 6y
0
Line 3. ChosenMap2 is wrapped in brackets, which are math exclusive. Remove them. User#19524 175 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

As incapaz said, you should wrap ChosenMap2 in brackets.

local ChoosenMap2 = game:GetService("ReplicatedStorage").Values:WaitForChild("ChoosenMap").Value

game:GetService("ServerStorage"):WaitForChild("Maps")[ChoosenMap2]:Clone().Parent = game:GetService("Workspace")

If it keeps erroring, make sure the map you input exists actually in the folder.

Ad

Answer this question