Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Services = setmetatable({},{__index=function(s,r) return game:service(r) end})
- Player = Services.Players.LocalPlayer
- wait()script.Parent=nil
- BodyParts={}
- abs = function(int)
- if int < 0 then return -int else return int end
- end
- rad = function(deg)
- return deg * math.pi / 180
- end
- deg = function(rad)
- return rad * 180 / math.pi
- end
- dist = function(p1,p2)
- r,e = ypcall(function()
- p1 = p1.Position
- end)
- if not r then p1 = p1 end
- r,e = ypcall(function()
- p2 = p2.Position
- end)
- if not r then p1 = p1 end
- return math.sqrt( (p2.X-p1.X)^2 + (p2.Y-p1.Y)^2 + (p2.Z-p1.Z)^2 )
- end
- function GetChar()
- return Player.Character
- end
- function GetHum()
- for i,v in pairs(GetChar():children'') do
- if v.ClassName == 'Humanoid' then
- return v
- end
- end
- end
- function Died()
- for i,v in pairs(GetChar():children'') do
- if v.ClassName == 'Part' then
- table.insert(BodyParts,{v.CFrame,v})
- elseif v.ClassName == 'Hat' then
- v.Parent=workspace
- table.insert(BodyParts,{v.Handle.CFrame,v.Handle,1})
- end
- end
- wait(3)
- for i,v in pairs(BodyParts) do
- v[2].Anchored=true
- if v[2].Name == 'Torso' then pos = v[1] end
- end
- for i,v in pairs(BodyParts) do
- coroutine.resume(coroutine.create(function()
- repeat Services.RunService.Heartbeat:wait()
- v[2].CFrame = v[2].CFrame:lerp(v[1],.1)
- until dist(v[2],v[1]) < .05
- v[2].CFrame=v[1]
- end))
- end
- end
- Player.CharacterAdded:connect(function(char)
- char:WaitForChild('Torso')
- for i,v in pairs(BodyParts) do
- if v[3] then
- v[2]:Remove()
- end
- end
- BodyParts={}
- char.Torso.CFrame=pos or CFrame.new(0,12,0)
- GetHum().Died:connect(Died)
- end)
- GetHum().Died:connect(Died)
- print'rannering'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement