Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(1)
- local remote = owner:FindFirstChild("drawremoterrerrereruwu934958")
- if remote == nil then
- remote = Instance.new("RemoteEvent",owner)
- remote.Name = "drawremoterrerrereruwu934958"
- end
- NLS([[wait(2)
- local history = {}
- local newhistory = {}
- local oldhistory = {}
- local equip = false
- local mousedown = false
- local rainbow = false
- local ctrl = false
- local shift = false
- local collide = false
- local undotick = tick()
- local scale = 1
- local distance = 0.1
- local layer = 1
- local color = Color3.fromRGB(255,125,255)
- local material = "Neon"
- local shape = 0 -- 0 = hex, 1 = square, 2 = cylinder
- local uis = game:GetService("UserInputService")
- local run = game:GetService("RunService")
- local mouse = game.Players.LocalPlayer:GetMouse()
- local lastdistance = Vector3.new(-1000,1000,-19934)
- local fold = workspace:FindFirstChild("imasmalllittlefolder3r34intheworkspacelol")
- local nilfolder = Instance.new("Folder")
- local tool = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
- local remote = game.Players.LocalPlayer:FindFirstChild("drawremoterrerrereruwu934958")
- tool.RequiresHandle = false
- local function deepCopy(original)
- local copy = {}
- for k, v in pairs(original) do
- if type(v) == "table" then
- v = deepCopy(v)
- end
- copy[k] = v
- end
- return copy
- end
- remote:FireServer()
- if fold == nil then
- fold = Instance.new("Folder",workspace)
- fold.Name = "imasmalllittlefolder3r34intheworkspacelol"
- else
- coroutine.resume(coroutine.create(function()
- wait(1)
- local tab2 = {{"Draw",{}}}
- local tab = {}
- for i,v in pairs(fold:GetChildren()) do
- if v:IsA("Part") then
- table.insert(tab,{v.CFrame,v.Size,v.Mesh.Scale,v.Color,v.CanCollide})
- table.insert(tab2[1][2],v.Name)
- end
- end
- history = deepCopy(tab2)
- remote:FireServer("Draw",{shape,tab})
- end))
- end
- --[==[
- for i,v in pairs(fold:GetChildren()) do
- if v:IsA("Part") then
- v:Destroy()
- end
- end]==]
- mouse.TargetFilter = fold
- local clon = Instance.new("Part")
- clon.Size = Vector3.new(1, 0.194, 1)
- clon.Orientation = Vector3.new(0,30,0)
- clon.Material = Enum.Material.Neon
- clon.Transparency = 0
- clon.Anchored = true
- clon.CanQuery = false
- clon.CanTouch = false
- clon.CanCollide = false
- clon.Locked = true
- local m = Instance.new("SpecialMesh",clon)
- m.MeshId = "rbxassetid://619431898"
- m.Scale = Vector3.new(0.5,0.5,0.5)
- uis.InputBegan:Connect(function(input,gameproc)
- if not gameproc then
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- if equip then
- lastdistance = Vector3.new(-1000,1000,-19934)
- oldhistory = {}
- newhistory = {"draw",{}}
- nilfolder:ClearAllChildren()
- end
- mousedown = true
- elseif input.UserInputType == Enum.UserInputType.Keyboard then
- if input.KeyCode == Enum.KeyCode.LeftControl and equip then
- ctrl = true
- end
- if input.KeyCode == Enum.KeyCode.LeftShift and equip then
- shift = true
- end
- end
- end
- end)
- uis.InputEnded:Connect(function(input,gameproc)
- if not gameproc then
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- mousedown = false
- if equip then
- local ding = deepCopy(newhistory[2])
- table.insert(history,{newhistory[1],ding})
- local new = {}
- for i,v in pairs(ding) do
- local v = fold:FindFirstChild(v)
- if v ~= nil then
- table.insert(new,{v.CFrame,v.Size,v.Mesh.Scale,v.Color,v.CanCollide})
- end
- end
- remote:FireServer("Draw",{shape,new})
- newhistory = {0,{}}
- end
- elseif input.UserInputType == Enum.UserInputType.Keyboard then
- if input.KeyCode ==Enum.KeyCode.LeftControl then
- ctrl = false
- end
- if input.KeyCode ==Enum.KeyCode.LeftShift then
- shift = false
- end
- if input.KeyCode == Enum.KeyCode.Z and ctrl and equip and not shift and tick() > undotick then
- -- undo
- mousedown = false
- wait()
- undotick = tick()+0.25
- remote:FireServer("Undo")
- if #history > 0 then
- local tab = deepCopy(history[#history])
- for i,v in pairs(tab[2]) do
- local part = fold:FindFirstChild(v)
- if part ~= nil then
- part.Parent = nilfolder
- end
- end
- wait()
- table.remove(history,#history)
- table.insert(oldhistory,tab)
- end
- end
- if input.KeyCode == Enum.KeyCode.Z and ctrl and shift and equip and tick() > undotick then
- -- redo alt
- undotick = tick()+0.25
- remote:FireServer("Redo")
- if #oldhistory > 0 then
- local tab = deepCopy(oldhistory[#oldhistory])
- for i,v in pairs(tab[2]) do
- local part = nilfolder:FindFirstChild(v)
- if part ~= nil then
- part.Parent = fold
- end
- end
- wait()
- table.remove(oldhistory,#oldhistory)
- table.insert(history,tab)
- end
- end
- if input.KeyCode == Enum.KeyCode.Y and ctrl and equip and tick() > undotick then
- -- redo
- undotick = tick()+0.25
- if #oldhistory > 0 then
- local tab = deepCopy(oldhistory[#oldhistory])
- for i,v in pairs(tab[2]) do
- local part = nilfolder:FindFirstChild(v)
- if part ~= nil then
- part.Parent = fold
- end
- end
- wait()
- table.remove(oldhistory,#oldhistory)
- table.insert(history,tab)
- end
- end
- if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and not ctrl and not shift and equip and not mousedown then
- layer = layer + 1
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and not ctrl and shift and equip and not mousedown then
- layer = layer + 10
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and ctrl and not shift and equip and not mousedown then
- layer = layer + 100
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- if (input.KeyCode == Enum.KeyCode.Equals or input.KeyCode == Enum.KeyCode.Plus) and ctrl and shift and equip and not mousedown then
- layer = layer + 1000
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- --
- if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and not ctrl and not shift and equip and not mousedown then
- layer = layer - 1
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and not ctrl and shift and equip and not mousedown then
- layer = layer - 10
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and ctrl and not shift and equip and not mousedown then
- layer = layer - 100
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- if (input.KeyCode == Enum.KeyCode.Minus or input.KeyCode == Enum.KeyCode.Underscore) and ctrl and shift and equip and not mousedown then
- layer = layer - 1000
- local g = tonumber(layer)
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- end
- end
- end
- end)
- local function char(plr)
- if plr.Character ~= nil and plr.Character.Parent ~= fold then
- coroutine.resume(coroutine.create(function()
- plr.Character.Parent = fold
- end))
- end
- plr.CharacterAdded:Connect(function(cha)
- wait(0.5)
- coroutine.resume(coroutine.create(function()
- plr.Character.Parent = fold
- end))
- end)
- end
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- char(v)
- end
- game:GetService("Players").PlayerAdded:Connect(function(plr)
- char(plr)
- end)
- tool.Equipped:Connect(function()
- equip = true
- end)
- tool.Unequipped:Connect(function()
- equip = false
- end)
- remote.OnClientEvent:Connect(function(mode,data)
- if mode == "Folder" then
- data.Parent = nil
- end
- end)
- owner.Chatted:Connect(function(msg)
- remote:FireServer("ChatCommand",msg)
- local split = string.split(msg,"/")
- if string.lower(split[1]) == ";color" then
- local r,g,b = tonumber(split[2]),tonumber(split[3]),tonumber(split[4])
- if r ~= nil and g ~= nil and b ~= nil then
- color = Color3.fromRGB(r,g,b)
- end
- print("Color set to Color3.fromRGB("..tostring(r)..","..tostring(g)..", "..tostring(b)..")",color)
- elseif string.lower(split[1]) == ";distance" then
- local g = tonumber(split[2])
- if g ~= nil then
- distance = g
- end
- print("Distance set to "..tostring(g).." studs.",color)
- elseif string.lower(split[1]) == ";layer" then
- local g = tonumber(split[2])
- if g ~= nil then
- layer = g
- end
- print("Layer set to "..tostring(g)..".",color)
- elseif string.lower(split[1]) == ";scale" then
- local g = tonumber(split[2])
- if g ~= nil then
- scale = g
- end
- print("Scale set to "..tostring(g*100).."%.",color)
- elseif string.lower(split[1]) == ";rgb" then
- local g = string.lower(split[2])
- if g == "on" then
- print("RGB is now on!",color)
- rainbow = true
- else
- print("RGB is now off!",color)
- rainbow = false
- end
- elseif string.lower(split[1]) == ";collide" then
- local g = string.lower(split[2])
- if g == "on" then
- print("CanCollide is now on!",color)
- collide = true
- else
- print("CanCollide is now off!",color)
- collide = false
- end
- end
- end)
- local rainbowrgb = 0 -- up to 360
- run.RenderStepped:Connect(function(heck)
- local part = mouse.Target
- local pos = mouse.Hit.Position
- if rainbow and mousedown then
- rainbowrgb = rainbowrgb + (60*heck)
- if rainbowrgb > 360 then
- rainbowrgb = 0
- end
- end
- --print(equip,mousedown)
- if equip then
- -- draw tim
- if mousedown then
- local clone = clon:Clone()
- clone.Position = Vector3.new(pos.X,part.Position.Y+(part.Size.Y/2),pos.Z)
- clone.Orientation = Vector3.new(0,30,0)
- clone.Size = Vector3.new(0.84*scale,part.Size.Y+(0.0015*layer),0.97*scale)
- clone.CFrame = clone.CFrame * CFrame.new(0,(-clone.Size.Y/2)+(0.0015*layer),0)
- clone.Name = "ownpee"..tostring(math.random(111111111,999999999))
- clone.CanCollide = collide
- if not rainbow then
- clone.Color = color
- else
- clone.Color = Color3.fromHSV(rainbowrgb/360,1,1)
- end
- clone.Material = material
- clone.Mesh.Scale = Vector3.new(0.5*scale,clone.Size.Y*2.5,0.5*scale)
- if (pos-lastdistance).Magnitude >= distance then
- lastdistance = pos
- clone.Parent = fold
- --top
- end
- table.insert(newhistory[2],clone.Name)
- end
- end
- end)
- ]],owner.Character)
- remote.OnServerEvent:Wait()
- local history = {}
- local newhistory = {}
- local oldhistory = {}
- local scale = 1
- local distance = 0.1
- local layer = 1
- local color = Color3.fromRGB(255,125,255)
- local material = "Neon"
- local shape = 0 -- 0 = hex, 1 = square, 2 = cylinder
- local fold = Instance.new("Folder",script)
- fold.Name = "imasmalllittlefolder3r35intheworkspacelol"
- local nilfolder = Instance.new("Folder")
- local clon = Instance.new("Part")
- clon.Size = Vector3.new(1, 0.194, 1)
- clon.Orientation = Vector3.new(0,30,0)
- clon.Material = Enum.Material.Neon
- clon.Transparency = 0
- clon.Anchored = true
- clon.CanQuery = false
- clon.CanTouch = false
- clon.CanCollide = false
- clon.Locked = true
- local m = Instance.new("SpecialMesh",clon)
- m.MeshId = "rbxassetid://619431898"
- m.Scale = Vector3.new(0.5,0.5,0.5)
- remote:FireClient(owner,"Folder",fold)
- local function deepCopy(original)
- local copy = {}
- for k, v in pairs(original) do
- if type(v) == "table" then
- v = deepCopy(v)
- end
- copy[k] = v
- end
- return copy
- end
- remote.OnServerEvent:Connect(function(plr,mode,data)
- if plr == owner then
- if mode == "Draw" then
- oldhistory = {}
- local shape = data[1]
- local parts = data[2]
- local bab = {}
- for i,v in pairs(parts) do
- local cf = v[1]
- local size = v[2]
- local scal = v[3]
- local color = v[4]
- local collide = v[5]
- local clone = clon:Clone()
- clone.Name = "ownpee"..tostring(math.random(111111111,999999999))
- clone.CFrame = cf
- clone.Size = size
- clone.Color = color
- clone.Mesh.Scale = scal
- clone.Parent = fold
- clone.CanCollide = collide
- table.insert(bab,clone.Name)
- end
- table.insert(history,{"Draw",bab})
- elseif mode == "Undo" then
- if #history > 0 then
- local tab = deepCopy(history[#history])
- for i,v in pairs(tab[2]) do
- local part = fold:FindFirstChild(v)
- if part ~= nil then
- part.Parent = nilfolder
- end
- end
- wait()
- table.remove(history,#history)
- table.insert(oldhistory,tab)
- end
- elseif mode == "Redo" then
- if #oldhistory > 0 then
- local tab = deepCopy(oldhistory[#oldhistory])
- for i,v in pairs(tab[2]) do
- local part = nilfolder:FindFirstChild(v)
- if part ~= nil then
- part.Parent = fold
- end
- end
- wait()
- table.remove(oldhistory,#oldhistory)
- table.insert(history,tab)
- end
- elseif mode == "ChatCommand" then
- local msg = data
- local split = string.split(msg,"/")
- if string.lower(split[1]) == ";color" then
- local r,g,b = tonumber(split[2]),tonumber(split[3]),tonumber(split[4])
- if r ~= nil and g ~= nil and b ~= nil then
- color = Color3.fromRGB(r,g,b)
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement