local Clone = Maps:FindFirstChild(MapName):Clone()
local Players = game.Players:GetPlayers()
Clone.Parent = workspace
Status.Value = MapName.. " Was Chosen"
wait(3)
Status.Value = "Loading Map..."
wait(2)
for i = 1, #Players do
local Player = game.Players:FindFirstChild(Players[i].Name)
local Character = Player.Character
local PlayerMarker = Instance.new("Humanoid")
Character.HumanoidRootPart.Position = Clone.SpawnParts:FindFirstChild("SpawnPart"..i).Position + Vector3.new(0,10,0)
PlayerMarker.Parent = rep.PlayersAlive
PlayerMarker.Name = Character.Name
Character.Humanoid.Died:Connect(function()
rep.PlayersAlive:FindFirstChild(Character.Name):Destroy()
end)
game.Players.PlayerRemoving:Connect(function(plr)
if plr.Name == Players.Name then
if rep.PlayersAlive:FindFirstChild(Character.Name) then
rep.PlayersAlive:FindFirstChild(Character.Name):Destroy()
end
end
end)
COMMUNITY QUESTION
ServerScriptService.MainScript:85: attempt to index nil with 'Position ,help?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.
