Advertisement
uor

semi godmode

uor
Aug 29th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. local stationaryrespawn = false
  2. local needsrespawning = false
  3. local haspos = false
  4. local pos = CFrame.new()
  5.  
  6. local Respawning = Instance.new("ScreenGui")
  7. local RespawningButton = Instance.new("TextButton")
  8.  
  9. Respawning.Name = "Respawning"
  10. Respawning.Parent = game.CoreGui
  11.  
  12.  
  13.  
  14. RespawningButton.Name = "RespawningButton"
  15. RespawningButton.Parent = Respawning
  16. RespawningButton.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  17. RespawningButton.BackgroundTransparency = 0.30000001192093
  18. RespawningButton.BorderSizePixel = 0
  19. RespawningButton.Position = UDim2.new(0.0391057241, 0, 0.826617789, 0)
  20. RespawningButton.Size = UDim2.new(0, 83, 0, 34)
  21. RespawningButton.Font = Enum.Font.SourceSans
  22. RespawningButton.Text = "Not Returning"
  23. RespawningButton.TextColor3 = Color3.new(1, 1, 1)
  24. RespawningButton.TextSize = 20
  25. RespawningButton.TextScaled = true
  26. RespawningButton.Draggable = true
  27.  
  28.  
  29.  
  30.  
  31. function StatRespawn(inputObject, gameProcessedEvent)
  32. if inputObject.KeyCode == Enum.KeyCode.N and gameProcessedEvent == false then
  33. stationaryrespawn = not stationaryrespawn
  34. end
  35. end
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. game:GetService("UserInputService").InputBegan:connect(StatRespawn)
  43.  
  44.  
  45.  
  46. game:GetService('RunService').Stepped:connect(function()
  47.  
  48.  
  49. if stationaryrespawn == true and game.Players.LocalPlayer.Character.Humanoid.Health == 0 then
  50. if haspos == false then
  51. pos = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  52. haspos = true
  53. end
  54.  
  55. needsrespawning = true
  56. end
  57.  
  58.  
  59. if needsrespawning == true then
  60. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = pos
  61. end
  62.  
  63.  
  64. if stationaryrespawn == true then
  65. RespawningButton.Text = "Returning"
  66. else
  67. RespawningButton.Text = "Not Returning"
  68. end
  69.  
  70.  
  71. end)
  72.  
  73. game.Players.LocalPlayer.CharacterAdded:connect(function()
  74. wait(5) --change this number if it takes longer to press a respawn button or sum
  75. needsrespawning = false
  76. haspos = false
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement