Advertisement
Thecodeeasar

Untitled

Oct 15th, 2024
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/shlexware/Orion/main/source')))()
  2. local Window = OrionLib:MakeWindow({Name = "Universal Hub by wutdahell510 on Roblox", HidePremium = false, SaveConfig = true, ConfigFolder = "SaveConfig"})
  3.  
  4. -- Initialize global user database if it doesn't exist
  5. if not _G.users then
  6. _G.users = {}
  7. end
  8.  
  9. local function isOwner()
  10. return game.Players.LocalPlayer.Name:lower() == "wutdahell510"
  11. end
  12.  
  13. local function getUserRank(player)
  14. local playerName = typeof(player) == "string" and player or player.Name
  15. if isOwner() then
  16. return "Owner"
  17. elseif _G.users[playerName] then
  18. return _G.users[playerName].rank
  19. else
  20. return "No Rank"
  21. end
  22. end
  23.  
  24. local function hasAccess(requiredRank)
  25. local playerRank = getUserRank(game.Players.LocalPlayer)
  26. return isOwner() or playerRank == requiredRank or (requiredRank == "Premium" and playerRank == "Content Creator")
  27. end
  28.  
  29. -- Function to add new user or update existing user
  30. local function addOrUpdateUser(username, rank)
  31. if not isOwner() then
  32. _G.users[username] = {
  33. rank = rank or "No Rank",
  34. joinTime = os.date("%Y-%m-%d %H:%M:%S"),
  35. inDiscord = false
  36. }
  37. end
  38. end
  39.  
  40. -- Add current player to users when script is executed
  41. addOrUpdateUser(game.Players.LocalPlayer.Name)
  42.  
  43. -- Update GUI to show current rank
  44. local function updateRankDisplay()
  45. local currentRank = getUserRank(game.Players.LocalPlayer)
  46. OrionLib:MakeNotification({
  47. Name = "Current Rank",
  48. Content = "Your current rank is: " .. currentRank,
  49. Image = "rbxassetid://4483345998",
  50. Time = 5
  51. })
  52. end
  53.  
  54. -- Main Tab
  55. local MainTab = Window:MakeTab({
  56. Name = "Main",
  57. Icon = "rbxassetid://4483345998",
  58. PremiumOnly = false
  59. })
  60.  
  61. MainTab:AddButton({
  62. Name = "Show My Rank",
  63. Callback = function()
  64. -- Refresh user data before displaying rank
  65. addOrUpdateUser(game.Players.LocalPlayer.Name)
  66. updateRankDisplay()
  67. end
  68. })
  69.  
  70. -- Databases Tab (Only for owner)
  71. if isOwner() then
  72. local DatabasesTab = Window:MakeTab({
  73. Name = "Databases",
  74. Icon = "rbxassetid://4483345998",
  75. PremiumOnly = false
  76. })
  77.  
  78. DatabasesTab:AddTextbox({
  79. Name = "Add/Update User Rank",
  80. Default = "",
  81. TextDisappear = false,
  82. Callback = function(username)
  83. DatabasesTab:AddDropdown({
  84. Name = "Select Rank",
  85. Default = "No Rank",
  86. Options = {"No Rank", "Premium", "Content Creator"},
  87. Callback = function(rank)
  88. addOrUpdateUser(username, rank)
  89. print(username .. " rank set to: " .. rank)
  90. OrionLib:MakeNotification({
  91. Name = "Rank Updated",
  92. Content = username .. " rank set to: " .. rank,
  93. Image = "rbxassetid://4483345998",
  94. Time = 5
  95. })
  96. end
  97. })
  98. end
  99. })
  100.  
  101. DatabasesTab:AddButton({
  102. Name = "View All Users",
  103. Callback = function()
  104. print("Owner: " .. game.Players.LocalPlayer.Name .. " (You)")
  105. for username, data in pairs(_G.users) do
  106. print(string.format("User: %s, Rank: %s, Join Time: %s, In Discord: %s",
  107. username, data.rank, data.joinTime, tostring(data.inDiscord)))
  108. end
  109. end
  110. })
  111. end
  112.  
  113. OrionLib:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement