Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this will let u play animations without dying and this works fine u can put like your real character somewhere in the distance on a baseplate frozen and use your real character to fling or sum
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local CLONE_DISTANCE = 5
- local myClone = nil
- local function createDummy()
- local dummy = Instance.new("Model")
- dummy.Name = "Clone"
- local hrp = Instance.new("Part")
- hrp.Name = "HumanoidRootPart"
- hrp.Size = Vector3.new(2, 2, 1)
- hrp.Transparency = 1
- hrp.CanCollide = false
- hrp.Parent = dummy
- local humanoid = Instance.new("Humanoid")
- humanoid.Parent = dummy
- local function createPart(name, size)
- local part = Instance.new("Part")
- part.Name = name
- part.Size = size
- part.TopSurface = Enum.SurfaceType.Smooth
- part.BottomSurface = Enum.SurfaceType.Smooth
- part.CanCollide = false
- part.Parent = dummy
- return part
- end
- local head = createPart("Head", Vector3.new(2, 1, 1))
- local headMesh = Instance.new("SpecialMesh")
- headMesh.MeshType = Enum.MeshType.Head
- headMesh.Scale = Vector3.new(1.25, 1.25, 1.25)
- headMesh.Parent = head
- local torso = createPart("Torso", Vector3.new(2, 2, 1))
- local leftArm = createPart("Left Arm", Vector3.new(1, 2, 1))
- local rightArm = createPart("Right Arm", Vector3.new(1, 2, 1))
- local leftLeg = createPart("Left Leg", Vector3.new(1, 2, 1))
- local rightLeg = createPart("Right Leg", Vector3.new(1, 2, 1))
- local function createMotor(name, part0, part1, c0, c1)
- local motor = Instance.new("Motor6D")
- motor.Name = name
- motor.Part0 = part0
- motor.Part1 = part1
- motor.C0 = c0
- motor.C1 = c1
- motor.Parent = part0
- return motor
- end
- createMotor("Neck", torso, head, CFrame.new(0, 1, 0), CFrame.new(0, -0.5, 0))
- createMotor("Left Shoulder", torso, leftArm, CFrame.new(-1, 0.5, 0), CFrame.new(0.5, 0.5, 0))
- createMotor("Right Shoulder", torso, rightArm, CFrame.new(1, 0.5, 0), CFrame.new(-0.5, 0.5, 0))
- createMotor("Left Hip", torso, leftLeg, CFrame.new(-0.5, -1, 0), CFrame.new(0, 1, 0))
- createMotor("Right Hip", torso, rightLeg, CFrame.new(0.5, -1, 0), CFrame.new(0, 1, 0))
- createMotor("Root Joint", hrp, torso, CFrame.new(0, 0, 0), CFrame.new(0, 0, 0))
- local face = Instance.new("Decal")
- face.Name = "face"
- face.Texture = "rbxasset://textures/face.png"
- face.Parent = head
- dummy.PrimaryPart = hrp
- return dummy
- end
- local function cloneCharacter()
- if not player.Character then
- return nil
- end
- character = player.Character
- humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
- if not humanoidRootPart then
- return nil
- end
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if not humanoid then
- return nil
- end
- local clone = createDummy()
- if not clone then
- return nil
- end
- local cloneRoot = clone:FindFirstChild("HumanoidRootPart")
- if cloneRoot then
- cloneRoot.CFrame = humanoidRootPart.CFrame * CFrame.new(0, 0, -CLONE_DISTANCE)
- end
- clone.Parent = workspace
- local success, desc = pcall(function()
- return humanoid:GetAppliedDescription()
- end)
- if success and desc then
- local cloneHumanoid = clone:FindFirstChildOfClass("Humanoid")
- if cloneHumanoid then
- pcall(function()
- cloneHumanoid:ApplyDescription(desc)
- end)
- end
- end
- return clone
- end
- wait(0.5)
- myClone = cloneCharacter()
- player.CharacterAdded:Connect(function(newChar)
- character = newChar
- humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- if myClone and myClone.Parent then
- myClone:Destroy()
- myClone = nil
- end
- wait(1)
- myClone = cloneCharacter()
- end)
Advertisement