Advertisement
BobMe

draw

Aug 7th, 2023 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.55 KB | None | 0 0
  1. wait(1)
  2. local remote = owner:FindFirstChild("drawremoterrerrereruwu934958")
  3.  
  4. if remote == nil then
  5. remote = Instance.new("RemoteEvent",owner)
  6. remote.Name = "drawremoterrerrereruwu934958"
  7. end
  8.  
  9. NLS([[wait(2)
  10. local history = {}
  11. local newhistory = {}
  12. local oldhistory = {}
  13. local equip = false
  14. local mousedown = false
  15. local rainbow = false
  16. local ctrl = false
  17. local shift = false
  18. local collide = false
  19. local undotick = tick()
  20. local scale = 1
  21. local distance = 0.1
  22. local layer = 1
  23. local color = Color3.fromRGB(255,125,255)
  24. local material = "Neon"
  25. local shape = 0 -- 0 = hex, 1 = square, 2 = cylinder
  26. local uis = game:GetService("UserInputService")
  27. local run = game:GetService("RunService")
  28. local mouse = game.Players.LocalPlayer:GetMouse()
  29. local lastdistance = Vector3.new(-1000,1000,-19934)
  30. local fold = workspace:FindFirstChild("imasmalllittlefolder3r34intheworkspacelol")
  31. local nilfolder = Instance.new("Folder")
  32. local tool = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
  33. local remote = game.Players.LocalPlayer:FindFirstChild("drawremoterrerrereruwu934958")
  34. tool.RequiresHandle = false
  35.  
  36. local function deepCopy(original)
  37. local copy = {}
  38. for k, v in pairs(original) do
  39. if type(v) == "table" then
  40. v = deepCopy(v)
  41. end
  42. copy[k] = v
  43. end
  44. return copy
  45. end
  46.  
  47. remote:FireServer()
  48.  
  49. if fold == nil then
  50. fold = Instance.new("Folder",workspace)
  51. fold.Name = "imasmalllittlefolder3r34intheworkspacelol"
  52. else
  53. coroutine.resume(coroutine.create(function()
  54. wait(1)
  55. local tab2 = {{"Draw",{}}}
  56. local tab = {}
  57. for i,v in pairs(fold:GetChildren()) do
  58. if v:IsA("Part") then
  59. table.insert(tab,{v.CFrame,v.Size,v.Mesh.Scale,v.Color,v.CanCollide})
  60. table.insert(tab2[1][2],v.Name)
  61. end
  62. end
  63. history = deepCopy(tab2)
  64. remote:FireServer("Draw",{shape,tab})
  65. end))
  66. end
  67.  
  68.  
  69. --[==[
  70. for i,v in pairs(fold:GetChildren()) do
  71. if v:IsA("Part") then
  72. v:Destroy()
  73. end
  74. end]==]
  75. mouse.TargetFilter = fold
  76. local clon = Instance.new("Part")
  77. clon.Size = Vector3.new(1, 0.194, 1)
  78. clon.Orientation = Vector3.new(0,30,0)
  79. clon.Material = Enum.Material.Neon
  80. clon.Transparency = 0
  81. clon.Anchored = true
  82. clon.CanQuery = false
  83. clon.CanTouch = false
  84. clon.CanCollide = false
  85. clon.Locked = true
  86. local m = Instance.new("SpecialMesh",clon)
  87. m.MeshId = "rbxassetid://619431898"
  88. m.Scale = Vector3.new(0.5,0.5,0.5)
  89.  
  90. uis.InputBegan:Connect(function(input,gameproc)
  91. if not gameproc then
  92. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  93. if equip then
  94. lastdistance = Vector3.new(-1000,1000,-19934)
  95. oldhistory = {}
  96. newhistory = {"draw",{}}
  97. nilfolder:ClearAllChildren()
  98. end
  99. mousedown = true
  100. elseif input.UserInputType == Enum.UserInputType.Keyboard then
  101. if input.KeyCode == Enum.KeyCode.LeftControl and equip then
  102. ctrl = true
  103. end
  104. if input.KeyCode == Enum.KeyCode.LeftShift and equip then
  105. shift = true
  106. end
  107. end
  108. end
  109. end)
  110. uis.InputEnded:Connect(function(input,gameproc)
  111. if not gameproc then
  112. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  113. mousedown = false
  114. if equip then
  115. local ding = deepCopy(newhistory[2])
  116. table.insert(history,{newhistory[1],ding})
  117. local new = {}
  118. for i,v in pairs(ding) do
  119. local v = fold:FindFirstChild(v)
  120. if v ~= nil then
  121. table.insert(new,{v.CFrame,v.Size,v.Mesh.Scale,v.Color,v.CanCollide})
  122. end
  123. end
  124. remote:FireServer("Draw",{shape,new})
  125. newhistory = {0,{}}
  126. end
  127. elseif input.UserInputType == Enum.UserInputType.Keyboard then
  128. if input.KeyCode ==Enum.KeyCode.LeftControl then
  129. ctrl = false
  130. end
  131. if input.KeyCode ==Enum.KeyCode.LeftShift then
  132. shift = false
  133. end
  134. if input.KeyCode == Enum.KeyCode.Z and ctrl and equip and not shift and tick() > undotick then
  135. -- undo
  136. mousedown = false
  137. wait()
  138. undotick = tick()+0.25
  139. remote:FireServer("Undo")
  140. if #history > 0 then
  141. local tab = deepCopy(history[#history])
  142. for i,v in pairs(tab[2]) do
  143. local part = fold:FindFirstChild(v)
  144. if part ~= nil then
  145. part.Parent = nilfolder
  146. end
  147. end
  148. wait()
  149. table.remove(history,#history)
  150. table.insert(oldhistory,tab)
  151. end
  152. end
  153. if input.KeyCode == Enum.KeyCode.Z and ctrl and shift and equip and tick() > undotick then
  154. -- redo alt
  155. undotick = tick()+0.25
  156. remote:FireServer("Redo")
  157. if #oldhistory > 0 then
  158. local tab = deepCopy(oldhistory[#oldhistory])
  159. for i,v in pairs(tab[2]) do
  160. local part = nilfolder:FindFirstChild(v)
  161. if part ~= nil then
  162. part.Parent = fold
  163. end
  164. end
  165. wait()
  166. table.remove(oldhistory,#oldhistory)
  167. table.insert(history,tab)
  168. end
  169. end
  170. if input.KeyCode == Enum.KeyCode.Y and ctrl and equip and tick() > undotick then
  171. -- redo
  172. undotick = tick()+0.25
  173. if #oldhistory > 0 then
  174. local tab = deepCopy(oldhistory[#oldhistory])
  175. for i,v in pairs(tab[2]) do
  176. local part = nilfolder:FindFirstChild(v)
  177. if part ~= nil then
  178. part.Parent = fold
  179. end
  180. end
  181. wait()
  182. table.remove(oldhistory,#oldhistory)
  183. table.insert(history,tab)
  184. end
  185. end
  186. if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and not ctrl and not shift and equip and not mousedown then
  187. layer = layer + 1
  188. local g = tonumber(layer)
  189. if g ~= nil then
  190. layer = g
  191. end
  192. print("Layer set to "..tostring(g)..".",color)
  193. end
  194. if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and not ctrl and shift and equip and not mousedown then
  195. layer = layer + 10
  196. local g = tonumber(layer)
  197. if g ~= nil then
  198. layer = g
  199. end
  200. print("Layer set to "..tostring(g)..".",color)
  201. end
  202. if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and ctrl and not shift and equip and not mousedown then
  203. layer = layer + 100
  204. local g = tonumber(layer)
  205. if g ~= nil then
  206. layer = g
  207. end
  208. print("Layer set to "..tostring(g)..".",color)
  209. end
  210. if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and ctrl and shift and equip and not mousedown then
  211. layer = layer + 1000
  212. local g = tonumber(layer)
  213. if g ~= nil then
  214. layer = g
  215. end
  216. print("Layer set to "..tostring(g)..".",color)
  217. end
  218. --
  219. if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and not ctrl and not shift and equip and not mousedown then
  220. layer = layer - 1
  221. local g = tonumber(layer)
  222. if g ~= nil then
  223. layer = g
  224. end
  225. print("Layer set to "..tostring(g)..".",color)
  226. end
  227. if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and not ctrl and shift and equip and not mousedown then
  228. layer = layer - 10
  229. local g = tonumber(layer)
  230. if g ~= nil then
  231. layer = g
  232. end
  233. print("Layer set to "..tostring(g)..".",color)
  234. end
  235. if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and ctrl and not shift and equip and not mousedown then
  236. layer = layer - 100
  237. local g = tonumber(layer)
  238. if g ~= nil then
  239. layer = g
  240. end
  241. print("Layer set to "..tostring(g)..".",color)
  242. end
  243. if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and ctrl and shift and equip and not mousedown then
  244. layer = layer - 1000
  245. local g = tonumber(layer)
  246. if g ~= nil then
  247. layer = g
  248. end
  249. print("Layer set to "..tostring(g)..".",color)
  250. end
  251. end
  252. end
  253. end)
  254.  
  255. local function char(plr)
  256. if plr.Character ~= nil and plr.Character.Parent ~= fold then
  257. coroutine.resume(coroutine.create(function()
  258. plr.Character.Parent = fold
  259. end))
  260. end
  261. plr.CharacterAdded:Connect(function(cha)
  262. wait(0.5)
  263. coroutine.resume(coroutine.create(function()
  264. plr.Character.Parent = fold
  265. end))
  266. end)
  267. end
  268.  
  269. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  270. char(v)
  271. end
  272. game:GetService("Players").PlayerAdded:Connect(function(plr)
  273. char(plr)
  274. end)
  275.  
  276. tool.Equipped:Connect(function()
  277. equip = true
  278. end)
  279.  
  280. tool.Unequipped:Connect(function()
  281. equip = false
  282. end)
  283.  
  284. remote.OnClientEvent:Connect(function(mode,data)
  285. if mode == "Folder" then
  286. data.Parent = nil
  287. end
  288. end)
  289.  
  290. owner.Chatted:Connect(function(msg)
  291. remote:FireServer("ChatCommand",msg)
  292. local split = string.split(msg,"/")
  293. if string.lower(split[1]) == ";color" then
  294. local r,g,b = tonumber(split[2]),tonumber(split[3]),tonumber(split[4])
  295. if r ~= nil and g ~= nil and b ~= nil then
  296. color = Color3.fromRGB(r,g,b)
  297. end
  298. print("Color set to Color3.fromRGB("..tostring(r)..","..tostring(g)..", "..tostring(b)..")",color)
  299. elseif string.lower(split[1]) == ";distance" then
  300. local g = tonumber(split[2])
  301. if g ~= nil then
  302. distance = g
  303. end
  304. print("Distance set to "..tostring(g).." studs.",color)
  305. elseif string.lower(split[1]) == ";layer" then
  306. local g = tonumber(split[2])
  307. if g ~= nil then
  308. layer = g
  309. end
  310. print("Layer set to "..tostring(g)..".",color)
  311. elseif string.lower(split[1]) == ";scale" then
  312. local g = tonumber(split[2])
  313. if g ~= nil then
  314. scale = g
  315. end
  316. print("Scale set to "..tostring(g*100).."%.",color)
  317. elseif string.lower(split[1]) == ";rgb" then
  318. local g = string.lower(split[2])
  319. if g == "on" then
  320. print("RGB is now on!",color)
  321. rainbow = true
  322. else
  323. print("RGB is now off!",color)
  324. rainbow = false
  325. end
  326. elseif string.lower(split[1]) == ";collide" then
  327. local g = string.lower(split[2])
  328. if g == "on" then
  329. print("CanCollide is now on!",color)
  330. collide = true
  331. else
  332. print("CanCollide is now off!",color)
  333. collide = false
  334. end
  335. end
  336. end)
  337. local rainbowrgb = 0 -- up to 360
  338.  
  339. run.RenderStepped:Connect(function(heck)
  340. local part = mouse.Target
  341. local pos = mouse.Hit.Position
  342. if rainbow and mousedown then
  343. rainbowrgb = rainbowrgb + (60*heck)
  344. if rainbowrgb > 360 then
  345. rainbowrgb = 0
  346. end
  347. end
  348. --print(equip,mousedown)
  349. if equip then
  350. -- draw tim
  351. if mousedown then
  352. local clone = clon:Clone()
  353. clone.Position = Vector3.new(pos.X,part.Position.Y+(part.Size.Y/2),pos.Z)
  354. clone.Orientation = Vector3.new(0,30,0)
  355. clone.Size = Vector3.new(0.84*scale,part.Size.Y+(0.0015*layer),0.97*scale)
  356. clone.CFrame = clone.CFrame * CFrame.new(0,(-clone.Size.Y/2)+(0.0015*layer),0)
  357. clone.Name = "ownpee"..tostring(math.random(111111111,999999999))
  358. clone.CanCollide = collide
  359. if not rainbow then
  360. clone.Color = color
  361. else
  362. clone.Color = Color3.fromHSV(rainbowrgb/360,1,1)
  363. end
  364. clone.Material = material
  365. clone.Mesh.Scale = Vector3.new(0.5*scale,clone.Size.Y*2.5,0.5*scale)
  366. if (pos-lastdistance).Magnitude >= distance then
  367. lastdistance = pos
  368. clone.Parent = fold
  369. --top
  370. end
  371. table.insert(newhistory[2],clone.Name)
  372. end
  373. end
  374. end)
  375. ]],owner.Character)
  376.  
  377. remote.OnServerEvent:Wait()
  378.  
  379. local history = {}
  380. local newhistory = {}
  381. local oldhistory = {}
  382. local scale = 1
  383. local distance = 0.1
  384. local layer = 1
  385. local color = Color3.fromRGB(255,125,255)
  386. local material = "Neon"
  387. local shape = 0 -- 0 = hex, 1 = square, 2 = cylinder
  388. local fold = Instance.new("Folder",script)
  389. fold.Name = "imasmalllittlefolder3r35intheworkspacelol"
  390. local nilfolder = Instance.new("Folder")
  391.  
  392. local clon = Instance.new("Part")
  393. clon.Size = Vector3.new(1, 0.194, 1)
  394. clon.Orientation = Vector3.new(0,30,0)
  395. clon.Material = Enum.Material.Neon
  396. clon.Transparency = 0
  397. clon.Anchored = true
  398. clon.CanQuery = false
  399. clon.CanTouch = false
  400. clon.CanCollide = false
  401. clon.Locked = true
  402. local m = Instance.new("SpecialMesh",clon)
  403. m.MeshId = "rbxassetid://619431898"
  404. m.Scale = Vector3.new(0.5,0.5,0.5)
  405.  
  406. remote:FireClient(owner,"Folder",fold)
  407.  
  408. local function deepCopy(original)
  409. local copy = {}
  410. for k, v in pairs(original) do
  411. if type(v) == "table" then
  412. v = deepCopy(v)
  413. end
  414. copy[k] = v
  415. end
  416. return copy
  417. end
  418.  
  419. remote.OnServerEvent:Connect(function(plr,mode,data)
  420. if plr == owner then
  421. if mode == "Draw" then
  422. oldhistory = {}
  423. local shape = data[1]
  424. local parts = data[2]
  425. local bab = {}
  426. for i,v in pairs(parts) do
  427. local cf = v[1]
  428. local size = v[2]
  429. local scal = v[3]
  430. local color = v[4]
  431. local collide = v[5]
  432.  
  433. local clone = clon:Clone()
  434. clone.Name = "ownpee"..tostring(math.random(111111111,999999999))
  435. clone.CFrame = cf
  436. clone.Size = size
  437. clone.Color = color
  438. clone.Mesh.Scale = scal
  439. clone.Parent = fold
  440. clone.CanCollide = collide
  441. table.insert(bab,clone.Name)
  442. end
  443. table.insert(history,{"Draw",bab})
  444. elseif mode == "Undo" then
  445. if #history > 0 then
  446. local tab = deepCopy(history[#history])
  447. for i,v in pairs(tab[2]) do
  448. local part = fold:FindFirstChild(v)
  449. if part ~= nil then
  450. part.Parent = nilfolder
  451. end
  452. end
  453. wait()
  454. table.remove(history,#history)
  455. table.insert(oldhistory,tab)
  456. end
  457. elseif mode == "Redo" then
  458. if #oldhistory > 0 then
  459. local tab = deepCopy(oldhistory[#oldhistory])
  460. for i,v in pairs(tab[2]) do
  461. local part = nilfolder:FindFirstChild(v)
  462. if part ~= nil then
  463. part.Parent = fold
  464. end
  465. end
  466. wait()
  467. table.remove(oldhistory,#oldhistory)
  468. table.insert(history,tab)
  469. end
  470. elseif mode == "ChatCommand" then
  471. local msg = data
  472. local split = string.split(msg,"/")
  473. if string.lower(split[1]) == ";color" then
  474. local r,g,b = tonumber(split[2]),tonumber(split[3]),tonumber(split[4])
  475. if r ~= nil and g ~= nil and b ~= nil then
  476. color = Color3.fromRGB(r,g,b)
  477. end
  478. end
  479. end
  480. end
  481. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement