Advertisement
CatGray

EXAMPLE

Feb 7th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local JrM = Instance.new("ScreenGui")
  3. JrM.Name = "JustAScript"
  4. JrM.Parent = player.PlayerGui
  5. local t=Instance.new("ScreenGui")
  6. t.Name="ToggleGui"
  7. t.Parent=game.Players.LocalPlayer.PlayerGui
  8. local b=Instance.new("TextButton")
  9. b.Text="Toggle"
  10. b.Size=UDim2.new(0,50,0,50)
  11. b.Position=UDim2.new(0,15,0,18)
  12. b.BackgroundColor3=Color3.new(0,0,0)
  13. b.BackgroundTransparency=0.5
  14. b.TextColor3=Color3.new(1,1,1)
  15. b.BorderColor3=Color3.new(1,1,1)
  16. b.Parent=t
  17. local function c()
  18. local g={"JustAScript"}
  19. for _,n in ipairs(g) do
  20. local r=game.Players.LocalPlayer.PlayerGui:GetDescendants()
  21. for _,i in ipairs(r) do
  22. if i.Name==n then
  23. i.Enabled=not i.Enabled
  24. end
  25. end
  26. end
  27. end
  28.  
  29. b.MouseButton1Click:Connect(c)
  30.  
  31. local JrMFrame = Instance.new("Frame")
  32. JrMFrame.Size = UDim2.new(0, 170, 0, 250)
  33. JrMFrame.Position = UDim2.new(0, 64, 0, -6)
  34. JrMFrame.BackgroundTransparency = 0.5
  35. JrMFrame.BackgroundColor3 = Color3.new(0, 0, 0)
  36. JrMFrame.BorderSizePixel = 2
  37. JrMFrame.BorderColor3 = Color3.new(1, 1, 1)
  38. JrMFrame.Parent = JrM
  39.  
  40. -- Enable dragging for the frame
  41. local draggingEnabled = false
  42. local dragInput, dragStart, startPos
  43.  
  44. JrMFrame.InputBegan:Connect(function(input)
  45. if input.UserInputType == Enum.UserInputType.Touch then
  46. draggingEnabled = true
  47. dragStart = input.Position
  48. startPos = JrMFrame.Position
  49. input.Changed:Connect(function()
  50. if input.UserInputState == Enum.UserInputState.End then
  51. draggingEnabled = false
  52. end
  53. end)
  54. end
  55. end)
  56.  
  57. JrMFrame.InputChanged:Connect(function(input)
  58. if input.UserInputType == Enum.UserInputType.Touch and draggingEnabled then
  59. local delta = input.Position - dragStart
  60. JrMFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  61. end
  62. end)
  63.  
  64. local munFrame = Instance.new("Frame")
  65. munFrame.Size = UDim2.new(0, 170, 0, 23)
  66. munFrame.Position = UDim2.new(0, 1, 0, -4)
  67. munFrame.BackgroundTransparency = 0.1
  68. munFrame.BackgroundColor3 = Color3.new(0, 0, 0)
  69. munFrame.BorderColor3 = Color3.new(1, 1, 1)
  70. munFrame.Parent = JrMFrame
  71.  
  72. local munLabel = Instance.new("TextLabel")
  73. munLabel.Text = "Just A Script"
  74. munLabel.Size = UDim2.new(1, 0, 1, 0)
  75. munLabel.Position = UDim2.new(0, 0, 0, 0)
  76. munLabel.TextColor3 = Color3.new(1, 1, 1)
  77. munLabel.BackgroundTransparency = 3
  78. munLabel.Parent = munFrame
  79.  
  80. local yOffset = 28
  81.  
  82. local function Manual(button)
  83. print("Infinite Yield")
  84. end
  85.  
  86. local function Script(button)
  87. print("Amazing Sound")
  88. end
  89.  
  90. local function createButton(name, onClick)
  91. local button = Instance.new("TextButton")
  92. button.Text = name
  93. button.Size = UDim2.new(0, 150, 0, 30)
  94. button.Position = UDim2.new(0, 12, 0, yOffset)
  95. button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8)
  96. button.TextColor3 = Color3.new(1, 1, 1)
  97. button.Parent = JrMFrame
  98. yOffset = yOffset + 40
  99.  
  100. button.MouseButton1Click:Connect(function()
  101. onClick(button)
  102. end)
  103.  
  104. return button
  105. end
  106.  
  107. createButton("Infinite Yield", Manual)
  108. createButton("Amazing Sound", Script)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement