Advertisement
scriptingtales

Useless GUI

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