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
The error suggests that there is nothing called "Teleportedd" in the player. Is it a spell error?
Well not sure what your trying to do here but if your trying to move players around inside your game just do something like:
Player.Character.Torso.Position = CFrame.new(math.random)
Not sure about the math.random part as I myself have never used it but I have used something very similar to teleport a player.