In a game I’m working on, I need a static clone of the character, as well as the original character. I’ve managed to clone the character using the following code:
local Character = game.Players:FindFirstChild(PlayerName).Character
Character.Archivable = true
local ClonedCharacter = Character:Clone()
Character.Archivable = false
ClonedCharacter.Archivable = false
ClonedCharacter.Parent = game.Workspace
local ClonedHumanoid = ClonedCharacter:FindFirstChild("Humanoid")
This works, and the cloned character appears in the Workspace right next to the real character. However, I need to make this clone sit on a seat, but when I run the following code, it doesn’t quite work.
Seat:Sit(ClonedHumanoid)
wait(0.1)
ClonedHumanoid:ChangeState(Enum.HumanoidStateType.Seated)
First off, I have the ChangeState()
line because for some reason, after running Seat:Sit(ClonedHumanoid)
without anything else, getting the humanoid’s state with GetState()
returns Enum.HumanoidStateType.Running
- which doesn’t really make sense.
But the weird part is that the clone is teleported to the seat, has it’s humanoid state as Seated
(only after using the ChangeState()
function), but the animation just isn’t playing/didn’t play.
Instead the clone is just kinda standing on it.
As far as I can tell, everything points to the clone being fully seated on the seat, but it just doesn’t look like it. When I tried to replicate the same code with the actual playable character and not the clone, it worked fine. So I don’t think it’s a problem with the part (could be wrong).
Any help would be greatly appreciated. I’ve been at this for nearly two hours lol
(All of this code is run on the server by the way)