hello, i am trying to make a game where one person is the murderer and the others are survivors i also made the countdown and the teleport and map picker also i made the script and stuff but i keep getting this error in my output: Character is not a valid member of Trail "Players.Trail

idk what it means with Players trail but here's the script:

local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerStorage = game:GetService("ServerStorage") local iamcool = true local Maps = ServerStorage:WaitForChild("Maps"):GetChildren() local Status = ReplicatedStorage:WaitForChild("Status") local PLA = game:GetService("Players") while iamcool do while #PLA:GetPlayers() < 2 do PLA.PlayerAdded:Wait() Status.Value = "You need 1 or more Players to play this game" end --Variables for the countdowns! local countdown = 5 local gamelength = 10 local gamewait = 5

repeat wait(1)
	countdown = countdown - 1
	
	Status.Value = "Game is starting in".. countdown
until countdown <= 0

wait(2)
Status.Value = "Choosing A Map!"
local randomMap = Maps[math.random(1, #Maps)]
local Spawns = randomMap:WaitForChild("Spawns"):GetChildren()
local randomspawn = Spawns[math.random(1, #Spawns)]
local ThePlayers = game.Players:GetPlayers()
local randomPlayer = ThePlayers[math.random(1, #ThePlayers)]
wait(4)
Status.Value = "Map Has Been Chosen!"
wait(3)
Status.Value = "Choosing Killer"
	wait(3)
Status.Value = randomPlayer.Name.." Has Been Chosen as the Killer"
wait(2)
for _, Player in pairs(ThePlayers) do
	if Player.Character and Player.Character:FindFirstChild('Humanoid') then
		Player.Team = game.Teams.Victims
	end
end

		wait(0.001)
	Status.Value = "Teleporting Players"
		wait(2)
		if game.Workspace.alanwalke.IsPlaying == true then
			game.Workspace.alanwalke:Pause()
		end
		for _, Player in pairs(ThePlayers) do
			if Player.Character and Player.Character:FindFirstChild('Humanoid') then
				local MapClone = randomMap:Clone()
				MapClone.Parent = game.Workspace
				for _, Player in pairs(ThePlayers) do
					if Player.Character and Player.Character:FindFirstChild('Humanoid') then
				Player.Character.Head.CFrame = randomspawn.CFrame
			end
		end
		
						Player.Character.Parent = game.Workspace.Surviviors
						wait(0.001)
						randomPlayer.Team = game.Teams.Killers
				randomPlayer.Character.Parent = game.Workspace.Killer
	randomPlayer.Character.Head.CFrame = game.Workspace.KillerSpawn.CFrame
				wait(1)
				local Survivors = game.Workspace.Surviviors:GetChildren()
				game.Workspace.Lockdown:Play()
				repeat wait(1)
		gamewait = gamewait - 1
		
		Status.Value = "The Killer Will Be Released In".. gamewait
				until gamewait <= 0
				Status.Value = "The Killer are released! Good Luck!"
				randomPlayer.Character.Humanoid.WalkSpeed = 40
				randomPlayer.Character.Humanoid.JumpPower = 100
				game.Workspace.Sound:Play()
				game.Workspace.scary:Play()
		randomPlayer.Character.Head.CFrame = randomspawn.CFrame
		local SwordClone = game.ReplicatedStorage.Sword:Clone()
		SwordClone.Parent = randomPlayer.Backpack
				wait(2)
				repeat wait(1)
		gamelength = gamelength - 1
		
		Status.Value = "The Game is Ending in:".. gamelength
						until gamelength <= 0
						Status.Value = "The Game just finished! gg!"
						MapClone:Destroy()
						SwordClone:Destroy()
						randomPlayer.Team = game.Teams.Lobby
						local plrs = game:GetService("Players")
						for _, Players in pairs(plrs:GetChildren()) do
							if Players.Character and Players.Character:FindFirstChild('Humanoid') then
				Players.Character:MoveTo(game.Workspace.LobbySpawns.SpawnLocation.Position)
			end
		end
		
				wait(5)
			end
		end
			
					end*

please help

2 comments

0

can you specify which line are you getting the error?

0

i got the error on line 76