i am trying when a player joins the game it will put him in a table and then make a check for if character exists and after that i want to clone his character to a floder on workspace
for some reason its not cloning it please help me with that i appreciate your help
local PlayersService = game:GetService("Players")
local Players = {}
function CloneCharacter(player)
Players = PlayersService:GetPlayers()
for i, v in pairs(Players) do
if player.Name == v.Name then
local Character = player.Character
if Character then
--This Mean That Found The Character
local ClonedCharacter = Character:Clone()
ClonedCharacter.Parent = workspace:FindFirstChild("ClonedCharacters")
print("Cloned Successfully")
else
print("Character not found")
end
end
end
end
game.Players.PlayerAdded:Connect(function(plr)
wait(5)
CloneCharacter(plr)
end)
error: β12: attempt to index nil with βParentββ