Advertisement
Peak7550

uwuware docs

Apr 16th, 2021 (edited)
3,700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.43 KB | None | 0 0
  1. --
  2. -- THIS DOCUMENTATION MIGHT HAVE A FEW MISSING THINGS, just look at the source if you can't get something to work
  3. --
  4.  
  5. --First define the library
  6. local Library = loadstring(game:HttpGet("https://pastebin.com/raw/edJT9EGX", true))()
  7. --To close/open the UI (after it's been initialized) use Library:Close() to toggle it, use the keybind option to quickly make a toggle for it without hassle (there is an example below)
  8.  
  9. --Making a window
  10. local Window = Library:CreateWindow"Window"
  11. --There is a special property for windows which can be set to false (Window.canInit = false), if done so the window will not be initialized when Library:Init() is called
  12.  
  13. --Making a folder
  14. Window:AddFolder"Folder"
  15. --Folders can be used exactly like windows, they can hold all the options, you can even put folders inside of folders inside of folders.. and so on
  16.  
  17. --[[
  18.     Adding otpions
  19.     All options will by default have their flag names set to whatever the text is, unless the flag is set
  20. ]]
  21.  
  22. --Label
  23. Window:AddLabel({text = "Label"})
  24.  
  25. --Button
  26. Window:AddButton({text = "Button", flag = "button", callback = function() print"pressed" end})
  27. --The flag for this option will be set to true after the button has been clicked, not sure how many uses there are for this
  28.  
  29. --Toggle
  30. Window:AddToggle({text = "Toggle", flag = "toggle", state = false, callback = function(a) print(a) end})
  31. Window:AddToggle({text = "Toggle", flag = "toggle1", state = true, callback = function(a) print(a) end})
  32. --If the state is set to true by default then it will fire the callback when the library is initialized
  33.  
  34. --List
  35. Window:AddList({text = "List", flag = "list", value = "Value", values = {"Value1", "Value2", "Value3", "Value4"}, callback = function(a) print(a) end})
  36. --If the set value is not in the values table then it will get added to it
  37.  
  38. --Textbox
  39. Window:AddBox({text = "Box", flag = "box", value = "Value", callback = function(a) print(a) end})
  40.  
  41. --Slider
  42. Window:AddSlider({text = "Slider", flag = "slider", value = 100, min = 20, max = 200, float = 0.3, callback = function(a) print(a) end})
  43. Window:AddSlider({text = "Slider", flag = "slider1", value = 0, min = -50, max = 100, callback = function(a) print(a) end})
  44.  
  45. --Keybind
  46. Window:AddBind({text = "Bind", flag = "bind", key = "MouseButton1", callback = function() print"pressed" end}) --key can also be Enum.UserInputType.MouseButton1, instead of the name/string
  47. Window:AddBind({text = "Bind", flag = "bind", hold = true, key = "E" , callback = function(a) if a then print"let go" else print"holding" end end}) --key can also be Enum.KeyCode.E, instead of the name/string
  48. --Window:AddBind({text = "Toggle UI", key = "RightShift", callback = function() library:Close() end})
  49.  
  50. --Color Picker
  51. Window:AddColor({text = "Color", flag = "color", color = Color3.fromRGB(255, 65, 65), callback = function(a) print(a) end})
  52. Window:AddColor({text = "Color", flag = "color", color = {1, 0.2, 0.2}, callback = function(a) print(a) end})
  53. --Uses a table instead of a color value (each value has to range from 0 to 1, think of it as using Color3.new), useful for loading json encoded options from a save file
  54.  
  55. --Initialize the library, so everything will get created
  56. Library:Init()
  57.  
  58. wait(5)
  59. print("Toggle is currently:", Library.flags["toggle"])
  60. print("Second toggle is currently:", Library.flags["toggle1"])
  61. --Flags can be useful for a lot of stuff, get creative with them :)
  62. --You can also get the value/state/key from each option if they're defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement