Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ply=game:service'Players'.LocalPlayer
- repeat wait()until ply~=nil
- char=ply.Character
- torso=char.Torso
- bcol=BrickColor.new
- cfn,md,mr,v3n=CFrame.new,math.rad,math.random,Vector3.new
- ang=function(x,y,z)return CFrame.Angles(x or 0,y or 0,z or 0)end
- Debris=game:service'Debris'
- m={}
- m.tau=math.pi*2
- m.floatforce = 196.25
- hum_root=char.HumanoidRootPart
- mouse=ply:GetMouse()
- function l(a,x,y,z,xx,yy,zz)
- if string.find(tostring(a),',') == nil then
- return (a.CFrame*CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0, zz or 0)
- else return (a * CFrame.new(x or 0,y or 0,z or 0))*CFrame.Angles(xx or 0,yy or 0,zz or 0)
- end
- end
- pcall(function() char.Stick:Destroy() end) --- Destroys Physical Tool
- Weapon = Instance.new("Model",char) Weapon.Name = 'Stick'
- Instance.new('BoolValue',Weapon).Name='Mug_Did'
- do --UTILITIES
- function Create(ClassName)
- local obj=Instance.new(ClassName)
- return function(props)
- obj.Parent=Weapon
- for key,val in pairs(props)do
- if key=='_P'then
- obj['Parent']=val
- elseif i=='_C'then
- obj[val[1]]:connect(val[2])
- else
- obj[key]=val
- end
- end
- return obj
- end
- end
- do --CREATION
- Cur_Parent=nil
- current_mat=nil
- anchor=false
- Part = function(x,y,z,color,tr,cc,an,parent)
- local p = Instance.new('Part',parent or Cur_Parent or Weapon)
- p.formFactor = 'Custom'
- p.Locked = true
- p.Position=torso.Position
- p.Size = Vector3.new(x,y,z)
- p.BrickColor = BrickColor.new(color or 'White')
- p.CanCollide = cc or false
- p.Anchored = an or anchor or false
- p.Transparency = tr or 0
- p.Material=current_mat or'SmoothPlastic'
- for i,v in pairs{'TopSurface','BottomSurface','FrontSurface','BackSurface','LeftSurface','RightSurface'}do
- p[v]=10
- end
- return p
- end
- Meshes = {Diamond='9756362';Spikeball='9982590';Table='111868131';
- Egg='1527559';Ring='3270017';Bullet='2697549';Grass='1080954';
- Shark='82821384';Sword='12221720';Crown='10688643';Spike='1033714';
- Leaf='48100239';Fist='65322375';Chakram='19251107';Crown='20329976';Spring='9753878';
- Tree='8564125';Fireball='10587413';DiamondBall='10917418'}
- Textures = {Leaf='rbxassetid://48047287';White='rbxassetid://5736319'}
- Mesh = function(par,num,x,y,z,tex)
- local msh = _
- if num == 1 then msh = Instance.new("CylinderMesh",par)
- elseif num == 2 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 3
- elseif num == 3 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 6
- elseif num == 4 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 'Wedge'
- elseif type(num) == 'string' then msh = Instance.new("SpecialMesh",par)
- if num=='Torso'then msh.MeshType=1 else
- msh.MeshId = string.find(num,'://') == nil and 'rbxassetid://'..Meshes[num] or num end
- end
- msh.Scale = Vector3.new(x or 1,y or 1,z or 1)
- if tex then
- msh.TextureId = Textures[tex] or tex or ''
- end
- return msh
- end
- end
- function tag(a,b)
- if type(b)=='string'then
- if not getfenv()[b]then
- getfenv()[b]={}
- end
- table.insert(getfenv()[b],a)
- else
- table.insert(b,a)
- end
- end
- pcall(function()ply.Backpack.DrawTool:Destroy()end)
- local hop=Create'HopperBin'{_P=ply.Backpack;Name='DrawTool'}
- history={}
- function onDown()
- holding=true
- st_pos=mouse.hit
- prev=st_pos
- local delta=0
- while holding do
- if delta>.001 then
- local mag=(prev.p-mouse.hit.p).magnitude
- local pp=Part(.1,.1,mag)pp.Anchored=true
- pp.CFrame=cfn(mouse.hit.p,prev.p)*cfn(0,0,-mag/2)
- table.insert(history,pp)
- end
- delta=(mouse.hit.p-prev.p).magnitude
- prev=mouse.hit
- wait()
- end
- end
- holding2=false
- function onUp()holding=false end
- function eraser()
- holding2=true
- while holding2 do
- for i,v in pairs(history)do
- if (v.Position-mouse.hit.p).magnitude < 3 then
- v:Destroy() table.remove(history,i)
- end
- end
- wait(.05)
- end
- end
- hop.Selected:connect(function(mouse)
- mouse.Button1Up:connect(onUp)
- mouse.KeyUp:connect(function(f)if f=='f'or f=='e'then holding2=false end end)
- mouse.KeyDown:connect(function(f)if f=='f'then
- holding2=true
- while holding2 do
- if history[#history]then
- history[#history]:Destroy()table.remove(history,#history)
- end
- wait()
- end
- elseif f=='e'then eraser()
- end
- end)
- mouse.Button1Down:connect(onDown)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement