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'
- r2 = "Cyan"
- --declarations
- PI=math.pi
- TAU=PI*2
- DEBRIS=game:service'Debris'
- mr,md=math.random,math.rad
- cfn,v3n=CFrame.new,Vector3.new
- _A=nil
- ang=function(x,y,z)local a=CFrame.Angles(x or 0,y or 0,z or 0)_A=a return a end
- RS=game:service'RunService'
- numkp=NumberSequenceKeypoint.new
- colkp=ColorSequenceKeypoint.new
- bcol=BrickColor.new
- RS:UnbindFromRenderStep('Anim')
- --player specific...
- player = game:service'Players'.LocalPlayer
- character = player.Character
- torso = character.Torso
- head = character.Head
- rarm = character['Right Arm']
- larm = character['Left Arm']
- rleg = character['Right Leg']
- rleg = character['Left Leg']
- human = character.Humanoid
- --Utilities... who needs them?
- function recurseHum(what)
- local res
- local p=what
- if what:IsA'Humanoid'then
- res=what
- else
- repeat
- p=p.Parent
- if p then
- local hum=p:FindFirstChild'Humanoid'
- if hum then
- res=hum
- break
- end
- end
- until p==nil
- end
- return res
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement