Hey there, been on this issue for awhile now and cant get it to work at all.
-
What do you want to achieve? Keep it simple and clear!
Clone a Model (basically a NPC) on death -
What is the issue? Include screenshots / videos if possible!
attempt to index nil with ‘Archivable’Error:
ServerScriptService.ClonePlayer:12: attempt to index nil with ‘Archivable’ - Server -
ClonePlayer:12 -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Devfourms
function respawnClone(player, Player1)
local playerToClone = player
local function CloneMe(char) --a function that clones a player
char.Archivable = true
local clone = char:Clone()
char.Archivable = false
return clone
end
local Player2 = CloneMe(Player1)
Player1:FindFirstChild("Humanoid").DisplayName = Player1.Name.. " / Player 1"
Player2.Name = player.Name.. " / Player 2"
Player2:FindFirstChild("Humanoid").DisplayName = Player2.Name
Player2.HumanoidRootPart.Position = workspace.PlayerSpawn.Player2Spawn.Position
Player2.Parent = workspace
local player2Humanoid = Player2:FindFirstChild("Humanoid")
player2Humanoid.Died:Connect(function()
task.wait(game.Players.RespawnTime)
respawnClone()
end)
end
game.Players.PlayerAdded:Connect(function(player)
local Player1 = player.Character or player.CharacterAdded:Wait()
--task.wait(0.25)
respawnClone(player, Player1)
end)