Advertisement
kill21_2

invizzz

May 6th, 2025 (edited)
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. local key = Enum.KeyCode.T -- Клавиша для переключения невидимости
  2. local invis_on = false
  3. local cooldown = false
  4.  
  5. -- Функция для показа уведомлений
  6. local function showNotification(title)
  7. game:GetService("StarterGui"):SetCore("SendNotification", {
  8. Title = title,
  9. Duration = 1,
  10. Text = "",
  11. })
  12. end
  13.  
  14. -- Основная функция обработки нажатия клавиши
  15. local function onKeyPress(inputObject, gameProcessedEvent)
  16. if gameProcessedEvent or cooldown then return end
  17. if inputObject.KeyCode == key then
  18. cooldown = true
  19.  
  20. local player = game:GetService("Players").LocalPlayer
  21. local character = player.Character
  22. if not character or not character:FindFirstChild("HumanoidRootPart") then
  23. cooldown = false
  24. return
  25. end
  26.  
  27. invis_on = not invis_on
  28.  
  29. if invis_on then
  30. -- Включаем невидимость
  31. local savedpos = character.HumanoidRootPart.CFrame
  32. character.HumanoidRootPart.CFrame = CFrame.new(0, -200, 0)
  33.  
  34. local Seat = Instance.new('Seat')
  35. Seat.Anchored = false
  36. Seat.CanCollide = false
  37. Seat.Name = 'invischair'
  38. Seat.Transparency = 1
  39. Seat.Parent = workspace
  40.  
  41. local torso = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso")
  42. if torso then
  43. local Weld = Instance.new("Weld")
  44. Weld.Part0 = Seat
  45. Weld.Part1 = torso
  46. Weld.Parent = Seat
  47. end
  48.  
  49. task.wait(0.15)
  50. Seat.CFrame = savedpos
  51. showNotification("Invis On")
  52. else
  53. -- Выключаем невидимость
  54. local chair = workspace:FindFirstChild('invischair')
  55. if chair then
  56. chair:Destroy()
  57. showNotification("Invis Off")
  58. end
  59. end
  60.  
  61. task.wait(0.5)
  62. cooldown = false
  63. end
  64. end
  65.  
  66. -- Подключаем обработчик ввода
  67. game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
  68.  
  69. -- Очистка при выходе из игры (опционально)
  70. game:GetService("Players").LocalPlayer.CharacterRemoving:Connect(function()
  71. local chair = workspace:FindFirstChild('invischair')
  72. if chair then chair:Destroy() end
  73. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement