Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. while wait(0.5) do
  2.     local part = nil
  3.     for i,x in pairs(script.Parent:GetChildren()) do
  4.         if x:FindFirstChildOfClass("Weld") then
  5.         else
  6.             if x:IsA("BasePart") then
  7.                 part = x
  8.             end
  9.         end
  10.     end
  11.     if script.Parent:FindFirstChild("BodyPosition") then
  12.         script.Parent.BodyPosition:Destroy()
  13.     end
  14.     local ray = Ray.new(part.Position,part.Position-Vector3.new(0,50,0))
  15.     print(part.Position-Vector3.new(0,50,0))
  16.     local ignore = script.Parent
  17.  
  18.     local hitpart, position = workspace:FindPartOnRay(ray, ignore)
  19.     local bodypos = Instance.new("BodyPosition",script.Parent)
  20.     bodypos.Position = position+Vector3.new(0,5,0)
  21.     bodypos.MaxForce = Vector3.new(50000,50000,50000)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement