Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function shrink(character, scale)
- if not character or not scale then return end
- --local cframe = character.Torso.CFrame
- local joints = {}
- local h = character:findFirstChild("Humanoid")
- if h then
- h.Parent = nil
- end
- for _,v in pairs(character:GetChildren()) do
- if v:IsA("BasePart") or v:IsA("UnionOperation") then
- for _,j in pairs(v:GetChildren()) do
- if j:IsA("Motor6D") or j:IsA("ManualWeld") then
- --print(j)
- local t = {
- Name = j.Name;
- Parent = v;
- Part0 = j.Part0;
- Part1 = j.Part1;
- C0 = j.C0;
- C1 = j.C1;
- }
- table.insert(joints,t)
- j:Destroy()
- end
- end
- elseif v:IsA("Part") then
- v.FormFactor = "Custom";
- v.Size = v.Size * scale
- v.Anchored = false
- elseif v:IsA("UnionOperation") then
- v.Size = v.Size * scale
- v.Anchored = false
- end
- character.torso.FormFactor = "Custom"
- character.torso.Size = character.torso.Size * scale
- end
- for _,j in pairs(joints) do
- local c0 = {j.C0:components()}
- local c1 = {j.C1:components()}
- for i = 1,3 do
- c0[i] = c0[i] * scale
- c1[i] = c1[i] * scale
- end
- j.C0 = CFrame.new(unpack(c0))
- j.C1 = CFrame.new(unpack(c1))
- local n = Instance.new("Motor6D")
- for k,v in pairs(j) do
- n[k] = v
- end
- end
- if h then
- h.Parent = character
- h.WalkSpeed = 16 * scale
- h.MaxHealth = 1*scale*105
- wait()
- h.Health = h.MaxHealth
- h.DisplayDistanceType = "None"
- end
- --character.Torso.CFrame = cframe
- end
- local sp = script.Parent
- sp.Touched:connect(function(hit)
- local character = hit.Parent
- if character:FindFirstChild("Humanoid") then
- if not character:FindFirstChild("Check") then
- if character:FindFirstChild("Chest") then
- for _,v in pairs(character:FindFirstChild("Chest"):GetChildren()) do
- v.Parent = character
- end
- end
- shrink(character,1.14)
- local check = Instance.new("BoolValue",character)
- check.Name = "Check"
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment