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 4 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

01local talking = game.ReplicatedStorage.Values.talking
02talking.Changed:Connect(function()
03    local character
04    if game.Players:GetPlayerFromCharacter(game.Workspace:FindFirstChild(talking.Value)) then --if character is a player
05        character = game.Players:GetPlayerFromCharacter(game.Workspace:FindFirstChild(talking.Value))
06        character.Archivable = true
07    elseif not game.Players:GetPlayerFromCharacter(game.Workspace:FindFirstChild(talking.Value)) and game.Workspace:FindFirstChild(talking.Value) then --if character is a npc
08        character = game.Workspace:FindFirstChild(talking.Value)
09    end
10    if character ~= nil then
11        local charClone = character:Clone()
12        print(charClone)
13    end
14end)

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