Advertisement
KirillKa2D

Universal speed

Nov 3rd, 2024
2,272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.68 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local humanoid = character:WaitForChild("Humanoid")
  4.  
  5. local screenGui = Instance.new("ScreenGui")
  6. screenGui.Parent = game.CoreGui
  7.  
  8. local frame = Instance.new("Frame")
  9. frame.Size = UDim2.new(0, 300, 0, 150) -- Увеличен размер панели
  10. frame.Position = UDim2.new(0.5, -150, 0.5, -75) -- Центрирование на экране с учётом нового размера
  11. frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  12. frame.Draggable = true
  13. frame.Active = true
  14. frame.Parent = screenGui
  15.  
  16. local jumpPowerBox = Instance.new("TextBox")
  17. jumpPowerBox.Size = UDim2.new(0, 150, 0, 50)
  18. jumpPowerBox.Position = UDim2.new(0, 0, 0, 0)
  19. jumpPowerBox.PlaceholderText = "Jump Power"
  20. jumpPowerBox.Parent = frame
  21.  
  22. local walkSpeedBox = Instance.new("TextBox")
  23. walkSpeedBox.Size = UDim2.new(0, 150, 0, 50)
  24. walkSpeedBox.Position = UDim2.new(0, 150, 0, 0)
  25. walkSpeedBox.PlaceholderText = "Walk Speed"
  26. walkSpeedBox.Parent = frame
  27.  
  28. local applyButton = Instance.new("TextButton")
  29. applyButton.Size = UDim2.new(0, 300, 0, 50)
  30. applyButton.Position = UDim2.new(0, 0, 0, 100)
  31. applyButton.Text = "Apply"
  32. applyButton.Parent = frame
  33.  
  34. local function applySettings()
  35.   local jumpPower = tonumber(jumpPowerBox.Text)
  36.   local walkSpeed = tonumber(walkSpeedBox.Text)
  37.   if jumpPower then
  38.     humanoid.JumpPower = jumpPower
  39.   end
  40.   if walkSpeed then
  41.     humanoid.WalkSpeed = walkSpeed
  42.   end
  43. end
  44.  
  45. applyButton.MouseButton1Click:Connect(applySettings)
  46.  
  47. player.CharacterAdded:Connect(function(newCharacter)
  48.   character = newCharacter
  49.   humanoid = character:WaitForChild("Humanoid")
  50. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement