Advertisement
DeathToTheStadium

Random ui Script

Oct 4th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.88 KB | None | 0 0
  1. --Scripted DeathToTheStadium
  2.  
  3. --SEVERSCRIPT
  4. wait(4)
  5. local Module = require(script.Parent.BasicFunctions)
  6.  
  7. local ScreenContainer = script.Parent.Parent
  8. local FramesFolder    = ScreenContainer:WaitForChild("Frames")
  9. local MainFrame       = ScreenContainer.MainFrame
  10. local ImageButton     = ScreenContainer.ImageButton
  11.  
  12.  
  13. local Credits = FramesFolder.Credits
  14. local Rules   = FramesFolder.Rules
  15. local Teams   = FramesFolder.Team
  16.  
  17. local CreditsButton = MainFrame.Credits
  18. local RulesButton   = MainFrame.Rules
  19. local TeamsButton   = MainFrame.Teams
  20.  
  21. local Color1 = Color3.new() -- Set your Colors
  22. local Color2 = Color3.new() -- Set your Colors
  23.  
  24.  
  25. local function SetVisibiility()
  26.     Module:IsVisible(Credits)
  27. end
  28.  
  29. for i,v in  pairs(FramesFolder:GetChildren()) do
  30.     local Frame = v
  31.     v.ImageButton.MouseButton1Down:Connect(function()  Module:IsVisible(Frame) end)
  32. end
  33.  
  34.  
  35. ImageButton.MouseButton1Down:Connect(function()
  36.     Module:ChangeButtonColor(ImageButton,Color3.new(119, 255, 61),Color3.new(0.764706, 0.921569, 0.188235))
  37.     Module:IsVisible(MainFrame)
  38. end)
  39. CreditsButton.MouseButton1Down:Connect(function() Module:IsVisible(Credits);  MainFrame.Visible = false; end)
  40. RulesButton.MouseButton1Down:Connect(function() Module:IsVisible(Rules); MainFrame.Visible = false;      end)
  41. TeamsButton.MouseButton1Down:Connect(function() Module:IsVisible(Teams); MainFrame.Visible = false;      end)
  42.  
  43. ---ModuleScript
  44.  
  45. local module = {}
  46. function module:IsVisible(Frame)
  47.     if Frame.Visible == true then
  48.         Frame.Visible = false
  49.     elseif Frame.Visible == false then
  50.         Frame.Visible = true
  51.     end
  52. end
  53.  
  54. function module:ChangeButtonColor(Imagebutton,Color1,Color2)
  55.     if Imagebutton.ImageColor3 == Color1 then
  56.         Imagebutton.ImageColor3 = Color2
  57.     elseif Imagebutton.ImageColor3 == Color2 then
  58.         Imagebutton.ImageColor3 = Color1
  59.     else
  60.         Imagebutton.ImageColor3 = Color1
  61.     end
  62. end
  63.  
  64. return module
  65.  
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement