Advertisement
scriptingtales

Useless GUI (Updated)

Mar 27th, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local UselessButton = Instance.new("TextButton")
  9. local Title = Instance.new("TextLabel")
  10. local Close = Instance.new("TextButton")
  11. local Toggle = Instance.new("TextButton")
  12.  
  13. --Properties:
  14.  
  15. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  16. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  17.  
  18. Frame.Parent = ScreenGui
  19. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  20. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  21. Frame.Position = UDim2.new(0.343030304, 0, 0.340220392, 0)
  22. Frame.Size = UDim2.new(0, 406, 0, 195)
  23. Frame.Visible = false
  24.  
  25. UselessButton.Name = "Useless Button"
  26. UselessButton.Parent = Frame
  27. UselessButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  28. UselessButton.Position = UDim2.new(0.252503991, 0, 0.457702816, 0)
  29. UselessButton.Size = UDim2.new(0, 200, 0, 50)
  30. UselessButton.Font = Enum.Font.PatrickHand
  31. UselessButton.Text = "Useless button"
  32. UselessButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  33. UselessButton.TextScaled = true
  34. UselessButton.TextSize = 14.000
  35. UselessButton.TextWrapped = true
  36.  
  37. Title.Name = "Title"
  38. Title.Parent = Frame
  39. Title.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  40. Title.Size = UDim2.new(0, 406, 0, 50)
  41. Title.Font = Enum.Font.PatrickHand
  42. Title.Text = "The Useless GUI"
  43. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  44. Title.TextScaled = true
  45. Title.TextSize = 14.000
  46. Title.TextWrapped = true
  47.  
  48. Close.Name = "Close"
  49. Close.Parent = Frame
  50. Close.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  51. Close.Position = UDim2.new(0.879310369, 0, 0, 0)
  52. Close.Size = UDim2.new(0, 49, 0, 50)
  53. Close.Font = Enum.Font.PatrickHand
  54. Close.Text = "X"
  55. Close.TextColor3 = Color3.fromRGB(0, 0, 0)
  56. Close.TextScaled = true
  57. Close.TextSize = 14.000
  58. Close.TextWrapped = true
  59.  
  60. Toggle.Name = "Toggle"
  61. Toggle.Parent = ScreenGui
  62. Toggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  63. Toggle.Position = UDim2.new(0, 0, 0.506887078, 0)
  64. Toggle.Size = UDim2.new(0, 200, 0, 50)
  65. Toggle.Font = Enum.Font.PatrickHand
  66. Toggle.Text = "Open"
  67. Toggle.TextColor3 = Color3.fromRGB(0, 0, 0)
  68. Toggle.TextScaled = true
  69. Toggle.TextSize = 14.000
  70. Toggle.TextWrapped = true
  71.  
  72. -- Scripts:
  73.  
  74. local function XCTFX_fake_script() -- UselessButton.LocalScript
  75. local script = Instance.new('LocalScript', UselessButton)
  76.  
  77. script.Parent.MouseButton1Click:Connect(function()
  78. game.Players.LocalPlayer:Kick("Useless GUI has Kicked you for being Useless (Joke)")
  79. end)
  80. end
  81. coroutine.wrap(XCTFX_fake_script)()
  82. local function DPTBTWS_fake_script() -- Frame.LocalScript
  83. local script = Instance.new('LocalScript', Frame)
  84.  
  85. local UIS = game:GetService("UserInputService")
  86. function dragify(Frame)
  87. dragToggle = nil
  88. local dragSpeed = 0
  89. dragInput = nil
  90. dragStart = nil
  91. local dragPos = nil
  92. function updateInput(input)
  93. local Delta = input.Position - dragStart
  94. local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
  95. game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.25), {Position = Position}):Play()
  96. end
  97. Frame.InputBegan:Connect(function(input)
  98. if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil then
  99. dragToggle = true
  100. dragStart = input.Position
  101. startPos = Frame.Position
  102. input.Changed:Connect(function()
  103. if input.UserInputState == Enum.UserInputState.End then
  104. dragToggle = false
  105. end
  106. end)
  107. end
  108. end)
  109. Frame.InputChanged:Connect(function(input)
  110. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  111. dragInput = input
  112. end
  113. end)
  114. game:GetService("UserInputService").InputChanged:Connect(function(input)
  115. if input == dragInput and dragToggle then
  116. updateInput(input)
  117. end
  118. end)
  119. end
  120.  
  121. dragify(script.Parent)
  122. end
  123. coroutine.wrap(DPTBTWS_fake_script)()
  124. local function WQAUNME_fake_script() -- Close.LocalScript
  125. local script = Instance.new('LocalScript', Close)
  126.  
  127. script.Parent.MouseButton1Click:Connect(function()
  128. script.Parent.Frame.Visible = false
  129. script.Parent.Close.Visible = false
  130. end)
  131. end
  132. coroutine.wrap(WQAUNME_fake_script)()
  133. local function GVEC_fake_script() -- Toggle.LocalScript
  134. local script = Instance.new('LocalScript', Toggle)
  135.  
  136. script.Parent.MouseButton1Click:Connect(function()
  137. script.Parent.Frame.Visible = true
  138. script.Parent.Toggle.Visible = false
  139. end)
  140. end
  141. coroutine.wrap(GVEC_fake_script)()
  142.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement