Why doesn't this script clone all inside of the character model?

  1. What do you want to achieve? A script that makes an exact copy of the player as they run, then it fades away and deletes itself

  2. What is the issue? I have a functioning script but some of the player’s 3d clothing isn’t being cloned and placed into the workspace
    here’s a video of it in action so you can get a better understanding:
    https://gyazo.com/d36348ff44809c1b60db0947fc567ca9

  3. What solutions have you tried so far? I tried looping through all of the player’s parts and clone them but that brough up random errors and didn’t work at all.

here’s the script:

local UserInputService = game:GetService("UserInputService")

local player = game.Players.LocalPlayer
local character = player.Character

local running = false

local tween

local function CloneMe(char) -- cloning the player
	char.Archivable = true
	local clone = char:Clone()
	char.Archivable = false
	return clone
end

UserInputService.InputBegan:Connect(function(input, processed)
	if processed then
		return
	end

	if input.KeyCode == Enum.KeyCode.LeftShift then
		character.Humanoid.WalkSpeed = 0
		wait(0.05)
		character.Humanoid.WalkSpeed = 100
		
		running = true
		
		while running == true do

			character.Animate.run.RunAnim.AnimationId = "rbxassetid://8897379586"
			
			local charClone = CloneMe(game.Players.LocalPlayer.Character)
			
			charClone:FindFirstChild("Humanoid"):Destroy()
			
			charClone.Parent = workspace
			
			for i, v in pairs(charClone:GetDescendants()) do -- getting the clone's parts and fading them out
				if v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("Texture") then
					v.Anchored = true
					v.CanCollide = false
					
					local info = TweenInfo.new(0.5)
					tween = game:GetService("TweenService"):Create(v, info, {Transparency = 1})
					tween:Play()
				end
			end
			
			tween.Completed:Connect(function() -- waiting for it to disappear before destroying
				charClone:Destroy()
			end)
			wait(0.05)
		end
	end
end)

UserInputService.InputEnded:Connect(function(input, processed)
	if processed then
		return
	end

	if input.KeyCode == Enum.KeyCode.LeftShift then
		running = false
		
		character.Animate.run.RunAnim.AnimationId = "rbxassetid://8484175485"

		character.Humanoid.WalkSpeed = 16
	end
end)

all help would be very appreciated.

1 Like

I think that’s because you removed the humanoid from the clone, i’m not sure, try to not remove it from the cloned character and tell me the result.

try put it on StarterPlayerScripts

this made it impossible for it to be non collidable. the weird thing is that it shows at some angles and doesn’t show when i look at it from another

are you sure that youll need to loop this with while loop

would I not? Im not sure it would work if I put it outside of the while true do loop

i think that’s because you should tween first the parts like “Head”, “Torso”, and after apply for loop to meshpart etc.

the while loop is really not needed

the local animate keys will not going to change once it was changed

and also
the tweens will have a same goal
once the object are tween to 0 they will tween again to 0 even they are already 0

so the while loop is really not needed

textures dont have a Anchored and CanCollide property

just make another statement for the texture

for i, v in pairs(charClone:GetDescendants()) do -- getting the clone's parts and fading them out
	local info = TweenInfo.new(0.5)
	if v:IsA("MeshPart") or v:IsA("BasePart") then
		v.Anchored = true
		v.CanCollide = false
		tween = game:GetService("TweenService"):Create(v, info, {Transparency = 1})
		tween:Play()
	elseif v:IsA("Texture") then
		tween = game:GetService("TweenService"):Create(v, info, {Transparency = 1})
		tween:Play()
	end
end
1 Like

not sure why that was causing an issue but it did solve it, tysm

1 Like