Advertisement
jxuser

Example UI LIB Usage

Jul 7th, 2025
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.60 KB | None | 0 0
  1. local UILib = loadstring(game:HttpGet("https://pastebin.com/raw/kZXaVZnS"))()
  2.  
  3. -- Set the window title
  4. UILib:SetTitle("Example Menu Title")
  5.  
  6. -- Section 1
  7. UILib:AddSection("Example Section 1")
  8.  
  9. -- Button (runs code on click)
  10. UILib:AddButton("Example button 1", function()
  11.     print("Button clicked!")
  12.     -- Put your code here
  13. end)
  14.  
  15. -- Toggle without loop (runs on toggle change, receives state)
  16. UILib:AddToggle("Toggle Example (No Loop)", function(state)
  17.     print("Toggle is now", state and "ON" or "OFF")
  18.     -- Run code when toggle changes
  19. end)
  20.  
  21. -- Toggle with loop and delay (runs repeatedly while ON)
  22. UILib:AddToggle("Toggle Example (With Loop)", {loop = true, loopdelay = 0.5}, function()
  23.     print("Looping while toggle is ON")
  24.     -- Looping code here; runs every 0.5 seconds while ON
  25. end)
  26.  
  27. -- Slider (runs on value change)
  28. UILib:AddSlider("Slider Example", {min = 0, max = 100, default = 50}, function(value)
  29.     print("Slider set to", value)
  30.     -- Use 'value' here for slider changes
  31. end)
  32.  
  33. -- Section 2
  34. UILib:AddSection("Example Section 2")
  35.  
  36. -- Another slider example
  37. UILib:AddSlider("Example Slider", {min = 0, max = 200, default = 16}, function(value)
  38.     print("Example Slider value:", value)
  39.     -- Use slider value here
  40. end)
  41.  
  42. -- Slider controlling JumpPower
  43. UILib:AddSlider("JumpPower", {min = 50, max = 200, default = 50}, function(value)
  44.     local player = game.Players.LocalPlayer
  45.     if player and player.Character and player.Character:FindFirstChild("Humanoid") then
  46.         player.Character.Humanoid.JumpPower = value
  47.         print("JumpPower set to", value)
  48.     end
  49. end)
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement