Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plr = owner
- char = plr.Character
- root = char.HumanoidRootPart
- Swait,swait = function(number)
- if number == 0 or number == nil then
- game:GetService("RunService").Heartbeat:Wait()
- else
- for i = 1,number do
- game:GetService("RunService").Heartbeat:Wait()
- end
- end
- end
- ezweld = function(p, a, b, cf)
- local weld = Instance.new("Weld",p)
- weld.Part0 = a
- weld.Part1 = b
- weld.C0 = cf
- return weld
- end
- NewSound = function(p, id, pit, vol, loop)
- local Sound = Instance.new("Sound",p)
- Sound.Pitch = pit
- Sound.Volume = vol
- Sound.SoundId = "rbxassetid://" ..id
- Sound.Looped = loop
- Sound:Play()
- return Sound
- end
- function fake(part, hide, join, p)
- local fake = Instance.new("Part", p)
- fake.Size = part.Size
- fake.Color = part.Color
- fake.Anchored = part.Anchored
- fake.CFrame = part.CFrame
- fake.CanCollide = part.CanCollide
- --fake.LeftSurface = part.LeftSurface
- --fake.RightSurface = part.RightSurface
- --fake.TopSurface = part.TopSurface
- --fake.BottomSurface = part.BottomSurface
- --fake.FrontSurface = part.FrontSurface
- --fake.BackSurface = part.BackSurface
- for i,v in pairs (part:children()) do
- if v:IsA("SpecialMesh") then
- v:Clone().Parent = fake
- end
- end
- if join == true then
- local weld = ezweld(part.Parent, fake, part, CFrame.new())
- end
- if hide == true then
- part.Transparency = 1
- end
- return fake
- end
- local model = Instance.new("Model", script)
- model.Name = plr.Name .."ghost"
- stopi = false
- plr.Chatted:connect(function(msg)
- if msg:sub(1, 5) == "/stop" then
- stopi = true
- for i,v in pairs (workspace:children()) do
- if v:IsA("Model") and v.Name == plr.Name .."ghost" then
- v:Destroy()
- end
- end
- script.Disabled = true
- end
- end)
- for i,v in pairs (char:children()) do
- if v:IsA("Part") and v ~= root then
- local E = fake(v, false, false, model)
- E.Name = v.Name
- E.Anchored = true
- end
- end
- rootj = root.RootJoint
- rootjnor = rootj.C0
- rootj.C0 = rootjnor * CFrame.new(0, 0, -875)
- for i,v in pairs (char:GetDescendants()) do
- if v:IsA("Hat") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") then
- v:remove()
- end
- if v:IsA("Part") then
- local mesh = Instance.new("SpecialMesh",v)
- mesh.Scale = Vector3.new(0, 0, 0)
- v.Transparency = 1
- end
- end
- function refit()
- model:remove()
- local rcf = root.CFrame
- plr:LoadCharacter()
- plr = plr
- mud = plr.Character
- char = mud
- char = mud
- root = char:WaitForChild("HumanoidRootPart")
- root.CFrame = rcf
- local model = Instance.new("Model", script)
- model.Name = plr.Name .."ghost"
- Instance.new("NumberValue", char).Name = "refitted"
- for i,v in pairs (char:children()) do
- if v:IsA("Part") and v ~= root then
- local E = fake(v, false, false, model)
- E.Name = v.Name
- E.Anchored = true
- end
- end
- rootj = root.RootJoint
- rootjnor = rootj.C0
- rootj.C0 = rootjnor * CFrame.new(0, 0, -875)
- for i,v in pairs (char:GetDescendants()) do
- if v:IsA("Hat") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") then
- v:remove()
- end
- if v:IsA("Part") then
- local mesh = Instance.new("SpecialMesh",v)
- mesh.Scale = Vector3.new(0, 0, 0)
- v.Transparency = 1
- end
- end
- char.Humanoid.Died:connect(refit)
- coroutine.resume(coroutine.create(function()
- while true do
- Swait()
- char = mud
- root = char.HumanoidRootPart
- if root and char then
- root.Anchored = false
- for i,v in pairs (model:children()) do
- if v:IsA("Part") then
- v.Parent = model
- v.CanCollide = false
- v.Transparency = 0.5
- v.Material = "Glass"
- v.Locked = true
- if v.Name == "Head" then
- v.Size = Vector3.new(1, 1, 1)
- v:ClearAllChildren()
- end
- local match = char:FindFirstChild(v.Name)
- if match ~= nil then
- v.Size = match.Size
- if v.Name == "Head" then
- v.Size = Vector3.new(v.Size.x/2, v.Size.y, v.Size.z)
- end
- v.CFrame = match.CFrame
- v.Position = v.Position + Vector3.new(0, 875, 0)
- end
- end
- end
- end
- end
- end))
- end
- char.Humanoid.Died:connect(refit)
- coroutine.resume(coroutine.create(function()
- while true do
- Swait()
- char = plr.Character
- root = char.HumanoidRootPart
- if root and char then
- root.Anchored = false
- for i,v in pairs (model:children()) do
- if v:IsA("Part") then
- v.Parent = model
- v.CanCollide = false
- v.Transparency = 0.5
- v.Material = "Glass"
- v.Locked = true
- if v.Name == "Head" then
- v.Size = Vector3.new(1, 1, 1)
- v:ClearAllChildren()
- end
- local match = char:FindFirstChild(v.Name)
- if match ~= nil then
- v.Size = match.Size
- if v.Name == "Head" then
- v.Size = Vector3.new(v.Size.x/2, v.Size.y, v.Size.z)
- end
- v.CFrame = match.CFrame
- v.Position = v.Position + Vector3.new(0, 875, 0)
- end
- end
- end
- end
- end
- end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement