Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why cant i clone a player's character?

Asked by 3 years ago

Im trying to make a camping game (srry for bad scripting) and when i try to clone a player's character i just get an error. Here is my code

local talking = game.ReplicatedStorage.Values.talking
talking.Changed:Connect(function()
    local character
    if game.Players:GetPlayerFromCharacter(game.Workspace:FindFirstChild(talking.Value)) then --if character is a player
        character = game.Players:GetPlayerFromCharacter(game.Workspace:FindFirstChild(talking.Value))
        character.Archivable = true
    elseif not game.Players:GetPlayerFromCharacter(game.Workspace:FindFirstChild(talking.Value)) and game.Workspace:FindFirstChild(talking.Value) then --if character is a npc
        character = game.Workspace:FindFirstChild(talking.Value)
    end
    if character ~= nil then
        local charClone = character:Clone()
        print(charClone)
    end
end)

so the weird thing is when i search for it people say to set the character's archivable to true but it still prints out nil.

Answer this question