Advertisement
Mrtomtomon

Untitled

Dec 14th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. repeat
  3. wait(1)
  4. until Player.Character
  5. local Character = Player.Character
  6. local Torso = Character:WaitForChild("Torso")
  7.  
  8. local Part = Instance.new("Part")
  9. Part.Anchored = true
  10. Part.CanCollide = false
  11. Part.Locked = true
  12. Part.Size = Vector3.new(20 , 0.1, 20)
  13. Part.TopSurface = Enum.SurfaceType.Smooth
  14. Part.BottomSurface = Enum.SurfaceType.Smooth
  15. Part.Transparency = 0.3
  16. Part.Color = Color3.new(0, 225/255, 255/255)
  17. Part.Parent = script
  18.  
  19. local lastTick = tick()
  20. local Cache = {}
  21. local power = 100
  22.  
  23. game:GetService("RunService").RenderStepped:connect(function(dt)
  24. if tick() - lastTick > 0.1 then
  25. for k,v in pairs(workspace:GetChildren()) do
  26. if v.Name ~= Player.Name and v:FindFirstChild("Humanoid") and v:FindFirstChild("Torso") then
  27. local offset = (v.Torso.Position - Part.Position)
  28. if not Cache[v.Name] then
  29. if offset.magnitude < Part.Size.X then
  30. local bodyvel = Instance.new("BodyVelocity")
  31. bodyvel.MaxForce = Vector3.new(1, 1, 1) * math.huge
  32. bodyvel.P = math.huge
  33. bodyvel.Velocity = offset.unit * power
  34. bodyvel.Parent = v.Torso
  35. Cache[v.Name] = bodyvel
  36. end
  37. else
  38. Cache[v.Name]:Destroy()
  39. Cache[v.Name] = nil
  40. end
  41. end
  42. end
  43. lastTick = tick()
  44. end
  45. Part.CFrame = Torso.CFrame *CFrame.new(0, -2.5, 0)
  46. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement