local player = game.Players.LocalPlayer
local LVL_1 = workspace.GameLevels.LVL_1:GetChildren()
function pickRandom(LVL)
local i = math.random(1, #LVL)
return LVL[i]
end
function tpToRandom(player, LVL)
local Room = pickRandom(LVL)
local Character = player.Character or player.CharacterAdded:Wait()
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
HumanoidRootPart.Position = Room.TpPoint.Position + Vector3.new(0,2.5,0)
end
function start(player)
tpToRandom(player, "LVL_1")
end
Any idea why it doesn’t work? I get this error: [14:58:06.527 - ServerScriptService.GameScript:22: attempt to index nil with 'TpPoint']