#Trying to clone a player's character
49 messages · Page 1 of 1 (latest)
I can show you the variables
yea thats mostly what i need
Its kind of hard to show what it is but it is a player
could you just send the whole code?
I dont really want anyone to copy it, its about 320 lines long
oh, aright then
can you show me just the variable for targetPlayer then?
just that line
for _, targetPlayer in ipairs(targetPlayers) do
i'll jsut assume that targetPlayers is defined right then
just searched it up
you need to make the clone archivable
local newPlayer = Chr:Clone()
newPlayer.Archivable = true
this is an example
Like this?
local clone = targetPlayer.Character:Clone()
clone.Archivable = true
clone.Parent = game.Workspace
clone.Position = targetPlayer.HumanoidRootPart.CFrame
yea, that should work fine
now it prints this:
ServerScriptService.Commands.Main:151: attempt to index nil with 'Archivable'
yes, it prints my username
yes, it prints "Players"
ok thats good
oh i didnt read far enough into the thread i read
you have to add a task.wait() apparently
after setting the clone.Archivable to true
im going to try to set the charactor to archivable insted of the clone
worth a shot
It clones now but it prints an error
whats the error
HumanoidRootPart is not a valid member of Player "Players.abcabcabdab"
is that on a later line?
its on the line "clone.Position = targetPlayer.HumanoidRootPart.CFrame"
maybe do a :WaitForChild()?
oh
wait
you get the HumanoidRootPart from the character, not the player
clone.Position = targetPlayer.Character.HumanoidRootPart.CFrame
do that
I tried that and it prints a different error
Position is not a valid member of Model "Workspace.abcabcabdab"
clone.HumanoidRootPart.CFrame = targetPlayer.Character.HumanoidRootPart.CFrame
that'll do the trick hopefully
It working now and it does not print any errors thank you for helping me
** You are now Level 4! **
yea ofc