Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- part = game.Workspace.username.Head --Enter your username here
- function loadpart(i,mode1)
- if i:IsA("Part") or i:IsA("MeshPart") then
- local newpart = i:Clone()
- newpart.Anchored = true
- newpart.CanCollide = false
- newpart.Parent = mode1
- if i.Parent:IsA("Accessory") or i.Parent:IsA("Hat") then
- if mode1:FindFirstChild(i.Parent.Name) == nil then
- local hatlol = i.Parent:Clone()
- hatlol.Parent = mode1
- --hatlol.Name = i.Parent.Name
- newpart.Parent = hatlol
- newpart.Anchored = false
- newpart.CFrame = i.CFrame + Vector3.new(0,0,60)
- newpart.Orientation = i.Orientation
- local killit = newpart:FindFirstChildOfClass("Weld")
- --killit:Destroy()
- end
- end
- if i:IsA("Weld") or i:IsA("WeldConstraint") or i:IsA("Motor6D") then
- local killi = newpart:FindFirstChildOfClass("Weld")
- --killi:Destroy()
- local kill = newpart:FindFirstChildOfClass("WeldConstraint")
- local kiru = newpart:FindFirstChildOfClass("Motor6D")
- --kill:Destroy()
- --kiru:Destroy()
- end
- if i:IsA("FileMesh") or i:IsA("SpecialMesh") then
- local newmesh = i:Clone()
- newmesh.Parent = newpart
- end
- end
- if i:IsA("Shirt") or i:IsA("Pants") or i:IsA("ShirtGraphic") then
- local newclothes = i:Clone()
- newclothes.Parent = mode1
- end
- end
- local touched = false
- if touched == false then
- touched = true
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- local model = Instance.new("Model",game.Workspace)
- local debounce = true
- while part.Parent.Humanoid.Health > 1 do
- local getparts = part.Parent:GetDescendants()
- model.AncestryChanged:Connect(function(_, parent)
- if not parent and debounce == true then
- debounce = false
- print("object destroyed!")
- local temp = Instance.new("Model",game.Workspace)
- model = temp
- end
- end)
- debounce = true
- for i=1, #getparts do
- local comp = model:FindFirstChild(getparts[i].Name)
- if comp ~= nil then
- if comp:IsA("Part") or comp:IsA("MeshPart") and getparts[i]:IsA("Part") or getparts[i]:IsA("MeshPart") then
- comp.CFrame = getparts[i].CFrame + Vector3.new(0,0,60)
- comp.Anchored = true
- end
- else
- loadpart(getparts[i],model)
- end
- if model:FindFirstChild("Humanoid") == nil then
- local render = part.Parent.Humanoid:Clone()
- render:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
- render.Parent = model
- local hpdb = true
- render.Died:Connect(function()
- if hpdb == true then
- hpdb = false
- part.Parent.Humanoid:TakeDamage(10)
- render.Health = render.MaxHealth
- wait(3)
- hpdb = true
- end
- end)
- render.HealthChanged:Connect(function()
- if hpdb == true then
- hpdb = false
- part.Parent.Humanoid:TakeDamage(1)
- render.Health = render.MaxHealth
- wait()
- hpdb = true
- end
- end)
- end
- model:BreakJoints()
- end
- wait(.15)
- end
- local modparts = model:GetDescendants()
- for i=1, #modparts do
- if modparts[i]:IsA("Part") or modparts[i]:IsA("MeshPart") then
- modparts[i].Anchored = false
- end
- end
- wait(5)
- model:Destroy()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement