Advertisement
anphu04

SISYPHUS simulator autoPUSH

Aug 18th, 2023 (edited)
1,672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. plr = game.Players.LocalPlayer
  2. root = plr.Character.HumanoidRootPart
  3. hum = plr.Character.Humanoid
  4. rock = workspace.Boulder
  5. mouse = plr:GetMouse()
  6.  
  7. on = true
  8. mouse.KeyDown:Connect(function(key)
  9.     if key == 'f' then
  10.         on = not on
  11.     end
  12. end)
  13.  
  14. local params = RaycastParams.new()
  15. params.FilterType = Enum.RaycastFilterType.Exclude
  16. params.FilterDescendantsInstances = {plr.Character}
  17.  
  18. bp = Instance.new('BodyPosition')
  19. bp.MaxForce = Vector3.new(999999,999999,999999)
  20. bp.P = 10000
  21.  
  22.  
  23. while hum.Health > 0 do
  24.     if on then
  25.         local spawncf = CFrame.new(rock.Position) * CFrame.Angles(0,math.pi/2,0) * CFrame.new(0,0,7)
  26.         local landing = workspace:Raycast(spawncf.p, spawncf.UpVector*-10, params)
  27.         if landing and landing.Position then
  28.             root.CFrame = spawncf * CFrame.new(0, landing.Position.Y - spawncf.p.Y + 3.5, 0)
  29.         end
  30.         --hum:MoveTo(root.Position + (rock.Position-root.Position).Unit * 100)
  31.        
  32.         bp.Parent = root
  33.         bp.Position = root.Position + (rock.Position-root.Position).Unit*30
  34.     else
  35.         bp.Parent = nil
  36.         hum:MoveTo(root.Position)
  37.     end
  38.    
  39.  
  40.     wait(.2)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement