Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont the text switch and why doesnt it tp me ?

if you help i will follow your roblox account

script:

local status = game.ReplicatedStorage.Status

local Maps = game.ReplicatedStorage.Maps:GetChildren()

local Maps = game.ReplicatedStorage.Maps:GetChildren()

while true do for i = 1,10 do status.Value = "Intermission "..10-i wait(1) end

local Random math.random(1, #Maps)

local map = Maps[Random]:Clone()
map.Parent = workspace

status.Value = "Challenge has been decided we will be playing "..map.Name
wait(4)

local players = game.Players:GetChildren()
for i = 1,#players do
	if players[i].Character ~= nil then
                local Teleports = math.random(1,#workspace.Teleports:GetChildren())
                players[i].Character:MoveTo(workspace.Teleports:GetChildren()[Teleports].Position)
            end
        end

end

error : 14:33:41.555 - ServerScriptService.Script:13: attempt to index nil with 'Clone'

2 comments

0

What happened to your code block?

0

code what?

1 answer

✓ Accepted answer

try local Random = math.random(1, #Maps) because Random is nil.

This discussion is preserved as it was. New answers, comments, and votes are closed.