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

How do I animate cloned player?

Asked by
Nickelz 37
5 years ago

I am trying to make an exact copy of a player when the player joins, but when I do this, it is not animated. Do you have to make a whole new animation script to put in this now NPC, or do you sort of "reload" the script? I've tried copying a script from a free model, and it works, but it causes errors in the developer console and the animation seems jaggy/blocky. Keep in mind this is not a request, it is asking a question.

Script I made to duplicate the player (it's only for the client)

game.Players.PlayerAdded:Connect(function(p)
    local plr = game.Workspace:WaitForChild(p.Name)
    plr.Archivable = true
    local clone = p.character:Clone()
    clone.Parent = game.Workspace
end)

1 answer

Log in to vote
0
Answered by
Imperialy 149
5 years ago

try renaming the humanoid of the characters clone so u can get it better

game.Players.PlayerAdded:Connect(function(player)
    local character = player.Character or player.CharacterAdded:Wait() -- gets the players character
    local cloned = character:Clone() -- clones it
    cloned.Humanoid.Name = "ClonedHumanoid" -- so you can find it without getting your character later on
    local animation = Instance.new("Animation") -- new animation
    animation.AnimationId = "rbxassetid://" -- after the rbxasset put your animationid
    local animtrack = cloned.ClonedHumanoid:LoadAnimation(animation) -- loads the animation
    animtrack.Priority = Enum.AnimationPriority.Action -- highest priority
    animtrack:Play() -- players the animation (you can play this later on if you'd like)
--[[
just a quick demonstration on how to play animations
--]]
end)
0
WAAAY too many comments. User#24403 69 — 5y
Ad

Answer this question