Advertisement
FazeWolfyBoy

Gravity Switch

Mar 26th, 2022
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. game.StarterGui:SetCore("SendNotification", {
  2. Title = "Gravity Switch";
  3. Text = "Gravity Switch On Press E";
  4. })
  5. if _G.WRDGravitySwitchStarted == nil then
  6. _G.WRDGravitySwitchStarted = true
  7.  
  8. --Gets the player's mouse
  9. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  10.  
  11. --Waits until the player's mouse is found
  12. repeat wait() until mouse
  13.  
  14. --Toggles
  15. mouse.KeyDown:connect(function(key)
  16. if key:lower() == "e" then
  17. if workspace.Gravity > 0 then
  18. --Turns off gravity
  19. workspace.Gravity = 0
  20. game.StarterGui:SetCore("SendNotification", {Title="Zero Gravity"; Text="Opexx"; Duration=1;})
  21. else
  22. --Reset to default
  23. workspace.Gravity = 196.2
  24. game.StarterGui:SetCore("SendNotification", {Title="Normal Gravity"; Text="Opexx"; Duration=1;})
  25. end
  26. end
  27. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement