Advertisement
DrawingJhon

BreakChair

Nov 9th, 2022 (edited)
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. local player = game:GetService("Players").LocalPlayer
  2. local char = player.Character
  3. local human = char.Humanoid
  4. local uis = game:GetService("UserInputService")
  5.  
  6. if _G.ResetSeat then
  7.     _G.ResetSeat()
  8. end
  9.  
  10. local jumping = false
  11. local lastSeat = nil
  12.  
  13. local conn = human:GetPropertyChangedSignal("SeatPart"):Connect(function()
  14.     if jumping then
  15.         lastSeat = nil
  16.         jumping = false
  17.         return
  18.     end
  19.    
  20.     local seat = human.SeatPart
  21.     if seat then
  22.         lastSeat = seat
  23.     elseif lastSeat then
  24.         lastSeat = nil
  25.         task.wait(0.05)
  26.         lastSeat:Sit(human)
  27.         print("Recoverint sit")
  28.     end
  29. end)
  30.  
  31. local jc = uis.JumpRequest:Connect(function()
  32.     jumping = true
  33. end)
  34.  
  35. _G.ResetSeat = function()
  36.     conn:Disconnect()
  37.     jc:Disconnect()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement