Advertisement
scriptingtales

Useless GUI

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