Advertisement
Guest User

Script For Fling

a guest
Dec 26th, 2023
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local seat = script.Parent
  2.  
  3. -- Function to fling the player off the seat
  4. local function flingPlayer(player)
  5. -- Check if the player is sitting on the seat
  6. if seat:IsPointTouching(seat.Position + Vector3.new(0, seat.Size.Y/2, 0)) then
  7. -- Calculate the fling direction
  8. local flingDirection = (seat.Position - player.Character.HumanoidRootPart.Position).unit
  9. -- Apply a force to fling the player
  10. player.Character.HumanoidRootPart.Velocity = flingDirection * 50 -- Adjust the fling force as needed
  11. end
  12. end
  13.  
  14. -- Touched event handler
  15. seat.Touched:Connect(function(KickOffSled)
  16. local KickOffSled = game.Workspace.otherPart
  17. if KickOffSled then
  18. flingPlayer(KickOffSled)
  19. print("it worked!1!")
  20. end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement