Advertisement
Descaii

Decondensed

Mar 31st, 2015
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. local GetRecursiveChildren=function(P)
  2.     local n,t,G={},table.foreach
  3.     function G(c,p)table.insert(n,p)t(p:GetChildren(),G) end
  4.     t(P:GetChildren(),G)
  5.     return n
  6. end
  7. function c(n)
  8.     for i,v in pairs(game.Players:GetPlayers())do
  9.         if n:IsDescendantOf(v.Character)then
  10.             return
  11.         end
  12.     end
  13.     return true
  14. end
  15. function ag(v)
  16.     if pcall(function()v:GetMass()end) and v.Name~="Base" and v~=Workspace.Terrain and c(v) and (function()if v:findFirstChild("BodyForce")then v.force:Destroy()return true end end) then
  17.         local f=Instance.new("BodyForce",v)
  18.         f.force=Vector3.new(0,v:GetMass()*196.2,0)
  19.         f.Changed:connect(function()
  20.             f.force=Vector3.new(0,v:GetMass()*196.2,0)
  21.         end)
  22.         v.Anchored=false;v:breakJoints()
  23.         v.DescendantAdded:connect(function()ag(v)end)
  24.     end
  25. end
  26. table.foreach(GetRecursiveChildren(Workspace),function(i,v) ag(v) end)
  27. Workspace.DescendantAdded:connect(function(v) ag(v) end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement