imaRapguy

Untitled

Sep 13th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.96 KB | None | 0 0
  1. -- Create ScreenGui
  2. local screenGui = Instance.new("ScreenGui")
  3. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  4.  
  5. -- Create Frame for background (Black Theme)
  6. local backgroundFrame = Instance.new("Frame")
  7. backgroundFrame.Size = UDim2.new(0, 300, 0, 400) -- Adjusted size to fit the new elements
  8. backgroundFrame.Position = UDim2.new(0.5, -150, 0.5, -200) -- Center the frame
  9. backgroundFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) -- Black background
  10. backgroundFrame.Active = true -- Enable dragging
  11. backgroundFrame.Draggable = true -- Make the GUI draggable for mobile and PC
  12. backgroundFrame.Parent = screenGui
  13.  
  14. -- Create smaller "X" button to close the GUI
  15. local closeButton = Instance.new("TextButton")
  16. closeButton.Size = UDim2.new(0, 30, 0, 30) -- Smaller size for the "X" button
  17. closeButton.Position = UDim2.new(0, 0, 0, 0) -- Top-left corner
  18. closeButton.Text = "X"
  19. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text for the "X"
  20. closeButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for the "X"
  21. closeButton.Parent = backgroundFrame
  22.  
  23. -- Create TextBox for Speed
  24. local textBox = Instance.new("TextBox")
  25. textBox.Size = UDim2.new(0, 250, 0, 50) -- Set size
  26. textBox.Position = UDim2.new(0.5, -125, 0.15, -25) -- Position inside the frame
  27. textBox.PlaceholderText = "Enter Number"
  28. textBox.Text = ""
  29. textBox.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  30. textBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for TextBox
  31. textBox.Parent = backgroundFrame
  32.  
  33. -- Create a white line between the speed TextBox and button
  34. local line1 = Instance.new("Frame")
  35. line1.Size = UDim2.new(0, 250, 0, 2) -- Thin line
  36. line1.Position = UDim2.new(0.5, -125, 0.33, 0) -- Positioned between TextBox and Button
  37. line1.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White line
  38. line1.Parent = backgroundFrame
  39.  
  40. -- Create Change Speed Button
  41. local changeSpeedButton = Instance.new("TextButton")
  42. changeSpeedButton.Size = UDim2.new(0, 250, 0, 50) -- Set size
  43. changeSpeedButton.Position = UDim2.new(0.5, -125, 0.35, -25) -- Position below the TextBox
  44. changeSpeedButton.Text = "Change Speed"
  45. changeSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  46. changeSpeedButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for button
  47. changeSpeedButton.Parent = backgroundFrame
  48.  
  49. -- Create TextBox for Jump Power
  50. local jumpPowerTextBox = Instance.new("TextBox")
  51. jumpPowerTextBox.Size = UDim2.new(0, 250, 0, 50) -- Set size
  52. jumpPowerTextBox.Position = UDim2.new(0.5, -125, 0.45, 25) -- Adjusted position for consistent spacing
  53. jumpPowerTextBox.PlaceholderText = "Enter Number"
  54. jumpPowerTextBox.Text = ""
  55. jumpPowerTextBox.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  56. jumpPowerTextBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for TextBox
  57. jumpPowerTextBox.Parent = backgroundFrame
  58.  
  59. -- Create Change Jump Power Button
  60. local changeJumpPowerButton = Instance.new("TextButton")
  61. changeJumpPowerButton.Size = UDim2.new(0, 250, 0, 50) -- Set size
  62. changeJumpPowerButton.Position = UDim2.new(0.5, -125, 0.65, 25) -- Position below the Jump Power TextBox
  63. changeJumpPowerButton.Text = "Change Jump Power"
  64. changeJumpPowerButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  65. changeJumpPowerButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background for button
  66. changeJumpPowerButton.Parent = backgroundFrame
  67.  
  68. -- Create Toggle Button to reopen GUI
  69. local toggleButton = Instance.new("TextButton")
  70. toggleButton.Size = UDim2.new(0, 100, 0, 50) -- Size of the toggle button
  71. toggleButton.Position = UDim2.new(0, 10, 0, 10) -- Position in the bottom left corner of the screen
  72. toggleButton.Text = "Toggle GUI"
  73. toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  74. toggleButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Dark grey background
  75. toggleButton.Parent = screenGui
  76. toggleButton.Visible = false -- Initially hidden until the GUI is closed
  77.  
  78. -- Function to change player's speed when the button is clicked
  79. changeSpeedButton.MouseButton1Click:Connect(function()
  80. local speedValue = tonumber(textBox.Text) -- Convert TextBox input to a number
  81. if speedValue then
  82. local player = game.Players.LocalPlayer
  83. local character = player.Character or player.CharacterAdded:Wait()
  84. local humanoid = character:WaitForChild("Humanoid")
  85.  
  86. -- Change the player's walk speed
  87. humanoid.WalkSpeed = speedValue
  88. else
  89. print("Please enter a valid number")
  90. end
  91. end)
  92.  
  93. -- Function to change player's jump power when the button is clicked
  94. changeJumpPowerButton.MouseButton1Click:Connect(function()
  95. local jumpPowerValue = tonumber(jumpPowerTextBox.Text) -- Convert Jump Power TextBox input to a number
  96. if jumpPowerValue then
  97. local player = game.Players.LocalPlayer
  98. local character = player.Character or player.CharacterAdded:Wait()
  99. local humanoid = character:WaitForChild("Humanoid")
  100.  
  101. -- Change the player's jump power
  102. humanoid.JumpPower = jumpPowerValue
  103. else
  104. print("Please enter a valid number")
  105. end
  106. end)
  107.  
  108. -- Function to close the GUI when "X" is clicked
  109. closeButton.MouseButton1Click:Connect(function()
  110. backgroundFrame.Visible = false -- Hide the background frame
  111. toggleButton.Visible = true -- Show the toggle button
  112. end)
  113.  
  114. -- Function to reopen the GUI when the toggle button is clicked
  115. toggleButton.MouseButton1Click:Connect(function()
  116. backgroundFrame.Visible = true -- Show the background frame
  117. toggleButton.Visible = false -- Hide the toggle button
  118. end)
  119.  
  120. -- Optional: Set default walk speed and jump power upon character respawn
  121. game.Players.LocalPlayer.CharacterAdded:Connect(function(character)
  122. local humanoid = character:WaitForChild("Humanoid")
  123. humanoid.WalkSpeed = 16 -- Roblox default walk speed
  124. humanoid.JumpPower = 50 -- Roblox default jump power
  125. end)
Advertisement
Add Comment
Please, Sign In to add comment