This script is supposed to teleport players once every life. However, the script doesn't work, but output did give me feedback. Can someone please help me?
Output: 11:03:09.389 - Teleportedd is not a valid member of Player 11:03:09.390 - Script 'Workspace.Player.Fix', Line 5
Script:
local Playing = game.ServerScriptService.MainGameScript.Variables:WaitForChild("Playing")
local Player = game.Players.LocalPlayer
local TeleVal = Player:WaitForChild("Teleportedd")
while wait(0.01) do
if Playing.Value == true and TeleVal.Value == false then
TeleVal.Value = true
BB = {}
DD = {}
GG = {}
RR = {}
for i,v in ipairs(game.Workspace.Map.Spawns.BBS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(BB,v)
end
end
for i,v in ipairs(game.Workspace.Map.Spawns.DDS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(DD,v)
end
end
for i,v in ipairs(game.Workspace.Map.Spawns.GGS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(GG,v)
end
end
for i,v in ipairs(game.Workspace.Map.Spawns.RRS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(RR,v)
end
end
if Player.TeamColor == BrickColor.new("Bright red") then
Player.Character:MoveTo(RR[math.random(1,#RR)].CFrame)
elseif Player.TeamColor == BrickColor.new("Bright blue") then
Player.Character:MoveTo(BB[math.random(1,#BB)].CFrame)
elseif Player.TeamColor == BrickColor.new("Bright yellow") then
Player.Character:MoveTo(DD[math.random(1,#DD)].CFrame)
elseif Player.TeamColor == BrickColor.new("Bright green") then
Player.Character:MoveTo(GG[math.random(1,#GG)].CFrame)
end
if Player.Lethals ~= nil then
local children = Player.Lethals:GetChildren()
for i = 1, #children do
children[i].Value = 2
end
end
end
end

1 comment
Your error isn't in this script. Check out the script called 'Fix' that gets added to the player's character.