Advertisement
C-H-4-0-S

Scriptmaster

Apr 25th, 2024 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.27 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local buttonActivated = false
  3. local gui = nil
  4.  
  5. -- Function to activate the script
  6. local function activateScript()
  7.  
  8. -- Create a ScreenGui to hold the GUI elements
  9. local gui = Instance.new("ScreenGui")
  10. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  11.  
  12. -- Create a Frame to hold the GUI elements
  13. local frame = Instance.new("Frame")
  14. frame.Parent = gui
  15. frame.Size = UDim2.new(0.6, 0, 0.6, 0)
  16. frame.Position = UDim2.new(0.2, 0, 0.2, 0)
  17. frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) -- Black background
  18.  
  19. -- Mouse input events
  20. local dragStart
  21. local dragging
  22.  
  23. frame.InputBegan:Connect(function(input)
  24. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  25. dragging = true
  26. dragStart = input.Position
  27. end
  28. end)
  29.  
  30. frame.InputChanged:Connect(function(input)
  31. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  32. local delta = input.Position - dragStart
  33. frame.Position = UDim2.new(0, frame.Position.X.Offset + delta.X, 0, frame.Position.Y.Offset + delta.Y)
  34. dragStart = input.Position
  35. end
  36. end)
  37.  
  38. frame.InputEnded:Connect(function(input)
  39. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  40. dragging = false
  41. end
  42. end)
  43.  
  44. -- Touch input events
  45. frame.InputBegan:Connect(function(input)
  46. if input.UserInputType == Enum.UserInputType.Touch then
  47. dragging = true
  48. dragStart = input.Position
  49. end
  50. end)
  51.  
  52. frame.InputChanged:Connect(function(input)
  53. if dragging and input.UserInputType == Enum.UserInputType.Touch then
  54. local delta = input.Position - dragStart
  55. frame.Position = UDim2.new(0, frame.Position.X.Offset + delta.X, 0, frame.Position.Y.Offset + delta.Y)
  56. dragStart = input.Position
  57. end
  58. end)
  59.  
  60. frame.InputEnded:Connect(function(input)
  61. if input.UserInputType == Enum.UserInputType.Touch then
  62. dragging = false
  63. end
  64. end)
  65.  
  66. -- Create a Title for the GUI
  67. local title = Instance.new("TextLabel")
  68. title.Parent = frame
  69. title.Size = UDim2.new(1, 0, 0.1, 0)
  70. title.Position = UDim2.new(0, 0, 0, 0)
  71. title.BackgroundTransparency = 1
  72. title.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  73. title.TextScaled = true
  74. title.Font = Enum.Font.SourceSansBold
  75. title.Text = "ScriptMaster v2"
  76.  
  77. -- Create an X button to close the GUI
  78. local xButton = Instance.new("TextButton")
  79. xButton.Parent = frame
  80. xButton.Size = UDim2.new(0.1, 0, 0.1, 0)
  81. xButton.Position = UDim2.new(0.9, 0, 0, 0)
  82. xButton.Text = "X"
  83. xButton.TextColor3 = Color3.fromRGB(255, 0, 0) -- Red text
  84. xButton.BackgroundTransparency = 1
  85. xButton.MouseButton1Click:Connect(function()
  86. gui:Destroy()
  87. end)
  88.  
  89. -- Create a TextBox for entering Lua code
  90. local textBox = Instance.new("TextBox")
  91. textBox.Parent = frame
  92. textBox.Size = UDim2.new(0.8, 0, 0.6, 0)
  93. textBox.Position = UDim2.new(0.1, 0, 0.1, 0)
  94. textBox.MultiLine = true
  95. textBox.TextWrapped = true
  96. textBox.ClearTextOnFocus = false
  97. textBox.Text = "Enter Lua code here"
  98. textBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
  99. textBox.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
  100. textBox.BorderSizePixel = 2
  101.  
  102. -- Create a Button to execute the Lua code
  103. local executeButton = Instance.new("TextButton")
  104. executeButton.Parent = frame
  105. executeButton.Size = UDim2.new(0.2, 0, 0.1, 0)
  106. executeButton.Position = UDim2.new(0.4, 0, 0.8, 0)
  107. executeButton.Text = "Execute"
  108. executeButton.MouseButton1Click:Connect(function()
  109. local luaCode = textBox.Text
  110. local success, errorMessage = pcall(loadstring(luaCode))
  111. if not success then
  112. print("Error executing Lua code:", errorMessage)
  113. end
  114. end)
  115.  
  116. -- Create a Notes button
  117. local notesButton = Instance.new("TextButton")
  118. notesButton.Parent = frame
  119. notesButton.Size = UDim2.new(0.1, 0, 0.1, 0)
  120. notesButton.Position = UDim2.new(0, 0, 0, 0)
  121. notesButton.Text = "Notes"
  122. notesButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  123. notesButton.BackgroundTransparency = 1
  124. notesButton.MouseButton1Click:Connect(function()
  125.  
  126. -- Create a ScreenGui to hold the GUI elements
  127. local gui = Instance.new("ScreenGui")
  128. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  129.  
  130. -- Create a Frame to hold the GUI elements
  131. local frame = Instance.new("Frame")
  132. frame.Parent = gui
  133. frame.Size = UDim2.new(0.6, 0, 0.6, 0)
  134. frame.Position = UDim2.new(0.2, 0, 0.2, 0)
  135. frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) -- Black background
  136.  
  137. -- Mouse input events
  138. local dragStart
  139. local dragging
  140.  
  141. frame.InputBegan:Connect(function(input)
  142. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  143. dragging = true
  144. dragStart = input.Position
  145. end
  146. end)
  147.  
  148. frame.InputChanged:Connect(function(input)
  149. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  150. local delta = input.Position - dragStart
  151. frame.Position = UDim2.new(0, frame.Position.X.Offset + delta.X, 0, frame.Position.Y.Offset + delta.Y)
  152. dragStart = input.Position
  153. end
  154. end)
  155.  
  156. frame.InputEnded:Connect(function(input)
  157. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  158. dragging = false
  159. end
  160. end)
  161.  
  162. -- Touch input events
  163. frame.InputBegan:Connect(function(input)
  164. if input.UserInputType == Enum.UserInputType.Touch then
  165. dragging = true
  166. dragStart = input.Position
  167. end
  168. end)
  169.  
  170. frame.InputChanged:Connect(function(input)
  171. if dragging and input.UserInputType == Enum.UserInputType.Touch then
  172. local delta = input.Position - dragStart
  173. frame.Position = UDim2.new(0, frame.Position.X.Offset + delta.X, 0, frame.Position.Y.Offset + delta.Y)
  174. dragStart = input.Position
  175. end
  176. end)
  177.  
  178. frame.InputEnded:Connect(function(input)
  179. if input.UserInputType == Enum.UserInputType.Touch then
  180. dragging = false
  181. end
  182. end)
  183.  
  184. -- Create a Title for the GUI
  185. local title = Instance.new("TextLabel")
  186. title.Parent = frame
  187. title.Size = UDim2.new(1, 0, 0.1, 0)
  188. title.Position = UDim2.new(0, 0, 0, 0)
  189. title.BackgroundTransparency = 1
  190. title.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
  191. title.TextScaled = true
  192. title.Font = Enum.Font.SourceSansBold
  193. title.Text = "ScriptNote v1"
  194.  
  195. -- Create an X button to close the GUI
  196. local xButton = Instance.new("TextButton")
  197. xButton.Parent = frame
  198. xButton.Size = UDim2.new(0.1, 0, 0.1, 0)
  199. xButton.Position = UDim2.new(0.9, 0, 0, 0)
  200. xButton.Text = "X"
  201. xButton.TextColor3 = Color3.fromRGB(255, 0, 0) -- Red text
  202. xButton.BackgroundTransparency = 1
  203. xButton.MouseButton1Click:Connect(function()
  204. gui:Destroy()
  205. end)
  206.  
  207. -- Create a TextBox for entering Lua code
  208. local textBox = Instance.new("TextBox")
  209. textBox.Parent = frame
  210. textBox.Size = UDim2.new(0.8, 0, 0.6, 0)
  211. textBox.Position = UDim2.new(0.1, 0, 0.1, 0)
  212. textBox.MultiLine = true
  213. textBox.TextWrapped = true
  214. textBox.ClearTextOnFocus = false
  215. textBox.Text = "Enter text here"
  216. textBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
  217. textBox.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
  218. textBox.BorderSizePixel = 2
  219.  
  220. -- Rainbow effect for the outline color of the TextBox
  221. local rainbowColors = {
  222. Color3.fromRGB(255, 0, 0), -- Red
  223. Color3.fromRGB(255, 127, 0), -- Orange
  224. Color3.fromRGB(255, 255, 0), -- Yellow
  225. Color3.fromRGB(0, 255, 0), -- Green
  226. Color3.fromRGB(0, 0, 255), -- Blue
  227. Color3.fromRGB(75, 0, 130) -- Indigo
  228. }
  229. local currentColorIndex = 1
  230.  
  231. while true do
  232. textBox.BorderColor3 = rainbowColors[currentColorIndex]
  233. wait(0.1)
  234. currentColorIndex = currentColorIndex % #rainbowColors + 1
  235. end
  236.  
  237. print("Notes button clicked")
  238. end)
  239.  
  240. -- Rainbow effect for the outline color of the TextBox
  241. local rainbowColors = {
  242. Color3.fromRGB(255, 0, 0), -- Red
  243. Color3.fromRGB(255, 127, 0), -- Orange
  244. Color3.fromRGB(255, 255, 0), -- Yellow
  245. Color3.fromRGB(0, 255, 0), -- Green
  246. Color3.fromRGB(0, 0, 255), -- Blue
  247. Color3.fromRGB(75, 0, 130) -- Indigo
  248. }
  249. local currentColorIndex = 1
  250.  
  251. while true do
  252. textBox.BorderColor3 = rainbowColors[currentColorIndex]
  253. wait(0.1)
  254. currentColorIndex = currentColorIndex % #rainbowColors + 1
  255. end
  256.  
  257. print("Script activated!")
  258. end
  259.  
  260. -- Function to delete the script
  261. local function deleteScript()
  262. script:Destroy()
  263. end
  264.  
  265. -- Function to toggle the button state
  266. local function toggleButton()
  267. if not buttonActivated then
  268. activateScript()
  269. buttonActivated = true
  270. else
  271. deleteScript()
  272. buttonActivated = false
  273. end
  274. end
  275.  
  276. -- Make the button draggable
  277. local function enableDragging(frame)
  278. local dragging
  279. local dragInput
  280. local dragStart
  281. local startPos
  282.  
  283. local function update(input)
  284. local delta = input.Position - dragStart
  285. frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  286. end
  287.  
  288. frame.InputBegan:Connect(function(input)
  289. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  290. dragging = true
  291. dragStart = input.Position
  292. startPos = frame.Position
  293.  
  294. input.Changed:Connect(function()
  295. if input.UserInputState == Enum.UserInputState.End then
  296. dragging = false
  297. end
  298. end)
  299. end
  300. end)
  301.  
  302. frame.InputChanged:Connect(function(input)
  303. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  304. dragInput = input
  305. end
  306. end)
  307.  
  308. game:GetService("UserInputService").InputChanged:Connect(function(input)
  309. if input == dragInput and dragging then
  310. update(input)
  311. end
  312. end)
  313. end
  314.  
  315. -- Create a ScreenGui and TextButton for the button
  316. gui = Instance.new("ScreenGui")
  317. gui.Parent = player.PlayerGui
  318.  
  319. local button = Instance.new("TextButton")
  320. button.Size = UDim2.new(0, 100, 0, 50)
  321. button.Position = UDim2.new(0.5, -50, 0.5, -25)
  322. button.Text = "Activate gui"
  323. button.Parent = gui
  324.  
  325. -- Enable dragging for the button
  326. enableDragging(button)
  327.  
  328. -- Connect the toggleButton function to the button's Click event
  329. button.MouseButton1Click:Connect(function()
  330. button.Visible = false
  331. toggleButton()
  332. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement