UltimateGate

Spray Can

Jul 21st, 2017
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.80 KB | None | 0 0
  1. --------------------------This is an Official script from Duelist--------------------------
  2. ---{-------------------- -------------------}---
  3. ---{-------------------- / \ -------------------}---
  4. ---{-------------------- II -------------------}---
  5. ---{-------------------- II -------------------}---
  6. ---{-------------------- II -------------------}---
  7. ---{-------------------- A========A -------------------}---
  8. ---{-------------------- II -------------------}---
  9. ---{-------------------- II -------------------}---
  10. ---{-------------------- W -------------------}---
  11. -------------------------------------------------------------------------------------------------------------
  12. -- Made by PPATTA/Cass/Inkyy/lynkss - I name change alot ---
  13.  
  14. plr=game:service'Players'.LocalPlayer
  15. ch=plr.Character
  16. tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint
  17. m,mouse=plr:GetMouse(),plr:GetMouse()
  18. cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new
  19. clr='White'
  20. sz=0.2
  21. mag=0.5
  22. undotable={}
  23. if ch:findFirstChild("Draw") then
  24. ch.Draw:Destroy()
  25. end
  26.  
  27. local tube=int("Model",ch)
  28. tube.Name='Draw'
  29.  
  30. getSound=function(id)
  31. local s=int("Sound",ch.Head)
  32. s.Volume=1
  33. s.SoundId=id
  34. return s
  35. end
  36.  
  37. local spray=getSound('rbxassetid://137065982')
  38. spray.Volume=0.5
  39.  
  40. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)--recommend to use this with my weld. use this function only with arm lockers.
  41. p0.Position = p1.Position
  42. local w = Instance.new('Motor',par or p0)
  43. w.Part0 = p1
  44. w.Part1 = p0
  45. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  46. w.MaxVelocity = .1
  47. return w
  48. end
  49.  
  50.  
  51. weld=function(p0,p1,c0)--basic weld function
  52. local w=Instance.new("Weld",p0)
  53. w.Part0=p0
  54. w.Part1=p1
  55. w.C0=c0
  56. return w
  57. end
  58.  
  59.  
  60. cp=function(parent,color,size,anchored,cancollide)--creates a part. automagically returns the part so you can edit it manually.
  61. local newp=Instance.new("Part",parent)
  62. newp.TopSurface='Smooth'
  63. newp.BottomSurface='Smooth'
  64. newp.FormFactor="Custom"
  65. newp.Material='SmoothPlastic'
  66. newp.BrickColor=BrickColor.new(color)
  67. newp.Size=size
  68. newp.Anchored=anchored
  69. newp.CanCollide=cancollide
  70. newp:BreakJoints()
  71. return newp
  72. end
  73. Tween = function(Weld, Stop, Step,a)
  74. ypcall(function()
  75. local func = function()
  76. local Start = Weld.C1
  77. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  78. local Stop = Stop
  79. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  80.  
  81. for i = 0, 1, Step or .1 do
  82. Weld.C1 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
  83. (Start.p.Y * (1 - i)) + (Stop.p.Y * i),
  84. (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  85. (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
  86. (Z1 * (1 - i)) + (Z2 * i) )
  87. wait()
  88. end
  89.  
  90. Weld.C1 = Stop
  91. end
  92.  
  93. if a then coroutine.wrap(func)() else func() end
  94. end)
  95. end
  96.  
  97.  
  98. cyl=function(prt)
  99. local c=int("CylinderMesh",prt)
  100. return c
  101. end
  102.  
  103. blo=function(prt)
  104. local c=int("BlockMesh",prt)
  105. return c
  106. end
  107.  
  108.  
  109. rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  110. rabr.Position = torso.Position
  111. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  112. w = Instance.new("Weld",tube)
  113. w.Part0,w.Part1 = ch['Right Arm'],rabr
  114. w.C1 = CFrame.new(0,-.5,0)
  115.  
  116. mh=cp(tube,"White",Vector3.new(0.6,1,0.6))
  117. cyl(mh)
  118. mw=weld(ch['Right Arm'],mh,cfn(0,-1,0)*ang(mr(-90),0,0))
  119.  
  120. mha=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6))
  121. cyl(mha).Scale=Vector3.new(0.85,1,0.85)
  122. weld(mh,mha,cfn(0,0.6,0))
  123.  
  124. local pz=cp(tube,"White",Vector3.new(0.6,0.2,0.6))
  125. cyl(pz).Scale=Vector3.new(0.9,0.4,0.9)
  126. weld(mha,pz,cfn(0,0,0))
  127.  
  128. local p=cp(tube,"Dark stone grey",Vector3.new(0.6,0.2,0.6))
  129. cyl(p).Scale=Vector3.new(0.95,0.4,0.95)
  130. weld(mh,p,cfn(0,0.5,0))
  131.  
  132. local pa=cp(tube,"Dark stone grey",Vector3.new(0.6,0.3,0.6))
  133. pa.Material='Plastic'
  134. cyl(pa).Scale=Vector3.new(1.1,1,1.1)
  135. weld(mh,pa,cfn(0,0,0))
  136.  
  137. local p=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6))
  138. p.Material='Plastic'
  139. cyl(p).Scale=Vector3.new(1.05,0.4,1.05)
  140. weld(pa,p,cfn(0,0.18,0))
  141. local p=cp(tube,"Really black",Vector3.new(0.6,0.2,0.6))
  142. p.Material='Plastic'
  143. cyl(p).Scale=Vector3.new(1.05,0.4,1.05)
  144. weld(pa,p,cfn(0,-0.18,0))
  145.  
  146.  
  147.  
  148. mha2=cp(tube,"White",Vector3.new(0.2,0.2,0.2))
  149. cyl(mha2).Scale=Vector3.new(1,1,1)
  150. weld(mha,mha2,cfn(0,0,-0.3)*ang(mr(-90),0,0))
  151. mha2b=cp(tube,"Really black",Vector3.new(0.2,0.2,0.2))
  152. cyl(mha2b).Scale=Vector3.new(0.9,1.02,0.9)
  153. weld(mha2,mha2b,cfn(0,0,0)*ang(0,0,0))
  154.  
  155.  
  156.  
  157.  
  158. local filtr=int("Model",ch)
  159. filtr.Name='TargetFilter'
  160. m.TargetFilter=filtr
  161. drawLine=function(point_a,point_b,bc_code)
  162. local dist=(point_a-point_b).magnitude;
  163. local rad=dist/2;
  164. local line=Instance.new('Part',filtr)--reparent as u wish
  165. line.Anchored=true;
  166. line.FormFactor='Custom';
  167. --line.Transparency=0.4
  168. line.Color=BrickColor.new(bc_code).Color;
  169. line.CanCollide=false;
  170. line.Size=Vector3.new(sz,.1,dist);
  171. Instance.new("BlockMesh",line).Name='blok'
  172. line.CFrame=CFrame.new(point_a,point_b)*CFrame.new(0,0,-rad);
  173. return line;
  174. end;
  175.  
  176. draw=false
  177. mha3=nil
  178. m.Button1Down:connect(function()
  179. if sheathed==false then
  180. for _,v in pairs(undotable) do
  181. ypcall(function()
  182. for i=1,10 do
  183. table.remove(undotable,_)
  184. end
  185. end)
  186. table.remove(undotable,_)
  187. end
  188. draw=true
  189. spray.Looped=true
  190. spray:Play()
  191. mha3=cp(tube,clr,Vector3.new(0.2,0.2,0.2),true,false)
  192. cyl(mha3).Scale=Vector3.new(1,1,1)
  193.  
  194.  
  195. position=m.Hit
  196. game:service'RunService'.RenderStepped:connect(function()
  197.  
  198. position=m.Hit
  199. local distance = (position.p - mha2.CFrame.p).magnitude
  200. mha3.Size=Vector3.new(0.2,distance,02)
  201. mha3.CFrame=CFrame.new(position.p, mha2.CFrame.p) * CFrame.new(0, 0, -distance/2)*ang(mr(-90),0,0)
  202. end)
  203. end
  204. end)
  205.  
  206. m.Button1Up:connect(function()
  207. spray:Stop()
  208. spray.Looped=false
  209. draw=false
  210. ypcall(function()
  211. mha3:Destroy()
  212. end)
  213. end)
  214.  
  215. plr.Chatted:connect(function(chat)
  216. if chat:sub(1,4)=='col;' and sheathed==false then
  217. ypcall(function()
  218. clr=string.sub(chat,5)
  219. mh.BrickColor=BrickColor.new(clr)
  220. pz.BrickColor=BrickColor.new(clr)
  221. Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3)
  222. Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3)
  223. Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3)
  224. Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3)
  225. end)
  226. elseif chat:sub(1,3)=='sz;' then
  227. sz=tonumber(string.sub(chat,4))
  228. elseif chat:sub(1,4)=='mag;' then
  229. mag=tonumber(string.sub(chat,5))
  230. end
  231. end)
  232.  
  233. tttable={}
  234.  
  235. sheathed=false
  236.  
  237. m.KeyUp:connect(function(key)
  238. if key=='z' then
  239. for i=1,10 do
  240. for _,v in pairs(undotable) do
  241. v:Destroy()
  242. table.remove(undotable,_)
  243. end
  244. end
  245. elseif key=='c' then
  246. for i=1,10 do
  247. for _,v in pairs(tttable) do
  248. ypcall(function()
  249. v:Destroy()
  250. end)
  251. table.remove(tttable,_)
  252. end
  253. end
  254. elseif key=='e' and sheathed==false then
  255. clr=tostring(BrickColor.Random())
  256. mh.BrickColor=BrickColor.new(clr)
  257. pz.BrickColor=BrickColor.new(clr)
  258. Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3)
  259. Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3)
  260. Tween(rw,cfn()*ang(mr(-110),mr(-20),mr(-10)),0.3)
  261. Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)),0.3)
  262. elseif key=='q' and sheathed==false then
  263. Tween(rw,cfn()*ang(0,0,0),0.2)
  264. mw:Destroy()
  265. mw=weld(torso,mh,CFrame.new(1.3,-1.6,0.16)*ang(math.rad(-30),0,0))
  266. rabr:Destroy()
  267. -- w:Destroy()
  268. --labr:Destroy()
  269. --ww:Destroy()
  270. sheathed=true
  271. elseif key=='q' and sheathed==true then
  272. mw:Destroy()
  273. ypcall(function()
  274. mw:Destroy()
  275. end)
  276. mw=weld(ch['Right Arm'],mh,cfn(0,-1,0)*ang(mr(-90),0,0))
  277. rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  278. rabr.Position = torso.Position
  279. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  280. w = Instance.new("Weld",tube)
  281. w.Part0,w.Part1 = ch['Right Arm'],rabr
  282. w.C1 = CFrame.new(0,-.5,0)
  283. Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)))
  284. sheathed=false
  285. end
  286. end)
  287.  
  288. Tween(rw,cfn()*ang(mr(-90),mr(-20),mr(-10)))
  289.  
  290. last=m.Hit
  291.  
  292.  
  293.  
  294. game:service'RunService'.RenderStepped:connect(function()
  295. if draw==false then
  296. last=m.Hit
  297. --Tween(rw,cfn()*ang(mr(-70),mr(-40),0),0.02)
  298. --Tween(rw,cfn()*ang(mr(-60),mr(-30),0),0.02)
  299. else
  300. ypcall(function()
  301. if m.Target and m.Target.Parent and m.Target.Parent:findFirstChild('Humanoid') then
  302. m.Target.Parent.Humanoid:TakeDamage(1)
  303. end
  304. end)
  305. coroutine.resume(coroutine.create(function()
  306. if m.Hit and m.Target then
  307. local c=m.Hit
  308. local m=(c.p-last.p).magnitude;
  309. if(m>mag)then
  310. local l=drawLine(last.p,c.p,clr);
  311. Instance.new("PointLight",l).Color=l.BrickColor.Color
  312. l.Material='Neon'
  313. table.insert(undotable,l)
  314. table.insert(tttable,l)
  315. last=c;
  316.  
  317. end;
  318. end
  319. end));
  320. end
  321. end)
  322.  
  323.  
  324.  
  325.  
  326. local plr = game:GetService('Players').LocalPlayer;
  327. local char = plr.Character;
  328. color1 = "Sand red"
  329. color2 = "Black"
  330.  
  331. local weld = function(p0,p1,x,y,z,ax,ay,az)
  332. p0.Position=p1.Position
  333. local w = Instance.new("Motor",p0)
  334. w.Part0=p0
  335. w.Part1=p1
  336. w.C0=CFrame.new(x,y,z)*CFrame.Angles(ax,ay,az)
  337. return w
  338. end
  339.  
  340. local strap1 = Instance.new("Part",char)
  341. strap1.Locked = true
  342. strap1.BrickColor = BrickColor.new(color2)
  343. strap1.Material = 'Fabric'
  344. strap1.Size = Vector3.new(.1,2.5,.1)
  345. weld(strap1,char['Torso'],0,0,.45,0,0,.8)
  346.  
  347. local strap2 = Instance.new("Part",char)
  348. strap2.Locked = true
  349. strap2.BrickColor = BrickColor.new(color2)
  350. strap2.Material = 'Fabric'
  351. strap2.Size = Vector3.new(.1,2.5,.1)
  352. weld(strap2,char['Torso'],0,0,-.45,0,0,.8)
  353.  
  354. local strap3 = Instance.new("Part",char)
  355. strap3.Locked = true
  356. strap3.BrickColor = BrickColor.new(color1)
  357. strap3.Material = 'Fabric'
  358. strap3.Size = Vector3.new(.3,.1,1.21)
  359. weld(strap3,char['Torso'],-.9,-.95,0,0,0,0)
  360.  
  361. local strap4 = Instance.new("Part",char)
  362. strap4.Locked = true
  363. strap4.CanCollide = false
  364. strap4.BrickColor = BrickColor.new(color1)
  365. strap4.Material = 'Fabric'
  366. strap4.Size = Vector3.new(.3,.4,.1)
  367. weld(strap4,char['Torso'],0,-1.13,.5,0,0,.8)
  368.  
  369. local strap5 = Instance.new("Part",char)
  370. strap5.Locked = true
  371. strap5.CanCollide = false
  372. strap5.BrickColor = BrickColor.new(color1)
  373. strap5.Material = 'Fabric'
  374. strap5.Size = Vector3.new(.3,.4,.1)
  375. weld(strap5,char['Torso'],0,-1.13,-.5,0,0,.8)
  376.  
  377. local bagwall1 = Instance.new("Part",char)
  378. bagwall1.Locked = true
  379. bagwall1.CanCollide = false
  380. bagwall1.BrickColor = BrickColor.new(color2)
  381. bagwall1.Material = 'Fabric'
  382. bagwall1.Size = Vector3.new(.1,1,.1)
  383. weld(bagwall1,char['Torso'],1,1.4,.8,0,0,0)
  384.  
  385. local bagwall2 = Instance.new("Part",char)
  386. bagwall2.Locked = true
  387. bagwall2.CanCollide = false
  388. bagwall2.BrickColor = BrickColor.new(color2)
  389. bagwall2.Material = 'Fabric'
  390. bagwall2.Size = Vector3.new(.1,1,.1)
  391. weld(bagwall2,char['Torso'],1,1.4,-.8,0,0,0)
  392.  
  393. local bagwall3 = Instance.new("Part",char)
  394. bagwall3.Locked = true
  395. bagwall3.CanCollide = false
  396. bagwall3.BrickColor = BrickColor.new(color2)
  397. bagwall3.Material = 'Fabric'
  398. bagwall3.Size = Vector3.new(.1,.1,1.4)
  399. weld(bagwall3,char['Torso'],1,1,0,0,0,0)
  400.  
  401. local bagwall4 = Instance.new("Part",char)
  402. bagwall4.Locked = true
  403. bagwall4.CanCollide = false
  404. bagwall4.BrickColor = BrickColor.new(color2)
  405. bagwall4.Material = 'Fabric'
  406. bagwall4.Size = Vector3.new(.1,.1,1.4)
  407. weld(bagwall4,char['Torso'],1,1.8,0,0,0,0)
  408.  
  409. local bagwall5 = Instance.new("Part",char)
  410. bagwall5.Locked = true
  411. bagwall5.CanCollide = false
  412. bagwall5.BrickColor = BrickColor.new(color1)
  413. bagwall5.Material = 'Fabric'
  414. bagwall5.Size = Vector3.new(.1,.6,1.4)
  415. weld(bagwall5,char['Torso'],1,1.4,0,0,0,0)
  416.  
  417. local bagwall6 = Instance.new("Part",char)
  418. bagwall6.Locked = true
  419. bagwall6.CanCollide = false
  420. bagwall6.BrickColor = BrickColor.new(color2)
  421. bagwall6.Material = 'Fabric'
  422. bagwall6.Size = Vector3.new(.8,.1,.1)
  423. weld(bagwall6,char['Torso'],1.5,1,.8,0,0,0)
  424.  
  425. local bagwall7 = Instance.new("Part",char)
  426. bagwall7.Locked = true
  427. bagwall7.CanCollide = false
  428. bagwall7.BrickColor = BrickColor.new(color2)
  429. bagwall7.Material = 'Fabric'
  430. bagwall7.Size = Vector3.new(.8,.1,.1)
  431. weld(bagwall7,char['Torso'],1.5,1,-.8,0,0,0)
  432.  
  433. local bagwall8 = Instance.new("Part",char)
  434. bagwall8.Locked = true
  435. bagwall8.CanCollide = false
  436. bagwall8.BrickColor = BrickColor.new(color2)
  437. bagwall8.Material = 'Fabric'
  438. bagwall8.Size = Vector3.new(.8,.1,.1)
  439. weld(bagwall8,char['Torso'],1.5,1.8,-.8,0,0,0)
  440.  
  441. local bagwall9 = Instance.new("Part",char)
  442. bagwall9.Locked = true
  443. bagwall9.CanCollide = false
  444. bagwall9.BrickColor = BrickColor.new(color2)
  445. bagwall9.Material = 'Fabric'
  446. bagwall9.Size = Vector3.new(.8,.1,.1)
  447. weld(bagwall9,char['Torso'],1.5,1.8,.8,0,0,0)
  448.  
  449. local bagwall10 = Instance.new("Part",char)
  450. bagwall10.Locked = true
  451. bagwall10.CanCollide = false
  452. bagwall10.BrickColor = BrickColor.new(color1)
  453. bagwall10.Material = 'Fabric'
  454. bagwall10.Size = Vector3.new(.8,.6,.1)
  455. weld(bagwall10,char['Torso'],1.5,1.4,.8,0,0,0)
  456.  
  457. local bagwall11 = Instance.new("Part",char)
  458. bagwall11.Locked = true
  459. bagwall11.CanCollide = false
  460. bagwall11.BrickColor = BrickColor.new(color1)
  461. bagwall11.Material = 'Fabric'
  462. bagwall11.Size = Vector3.new(.8,.6,.1)
  463. weld(bagwall11,char['Torso'],1.5,1.4,-.8,0,0,0)
  464.  
  465. local bagwall12= Instance.new("Part",char)
  466. bagwall12.Locked = true
  467. bagwall12.CanCollide = false
  468. bagwall12.BrickColor = BrickColor.new(color2)
  469. bagwall12.Material = 'Fabric'
  470. bagwall12.Size = Vector3.new(.1,1,.1)
  471. weld(bagwall12,char['Torso'],2,1.4,.8,0,0,0)
  472.  
  473. local bagwall13 = Instance.new("Part",char)
  474. bagwall13.Locked = true
  475. bagwall13.CanCollide = false
  476. bagwall13.BrickColor = BrickColor.new(color2)
  477. bagwall13.Material = 'Fabric'
  478. bagwall13.Size = Vector3.new(.1,1,.1)
  479. weld(bagwall13,char['Torso'],2,1.4,-.8,0,0,0)
  480.  
  481. local bagwall14 = Instance.new("Part",char)
  482. bagwall14.Locked = true
  483. bagwall14.CanCollide = false
  484. bagwall14.BrickColor = BrickColor.new(color2)
  485. bagwall14.Material = 'Fabric'
  486. bagwall14.Size = Vector3.new(.1,.1,1.4)
  487. weld(bagwall14,char['Torso'],2,1,0,0,0,0)
  488.  
  489. local bagwall15 = Instance.new("Part",char)
  490. bagwall15.Locked = true
  491. bagwall15.CanCollide = false
  492. bagwall15.BrickColor = BrickColor.new(color2)
  493. bagwall15.Material = 'Fabric'
  494. bagwall15.Size = Vector3.new(.1,.1,1.4)
  495. weld(bagwall15,char['Torso'],2,1.8,0,0,0,0)
  496.  
  497. local bagwall16 = Instance.new("Part",char)
  498. bagwall16.Locked = true
  499. bagwall16.CanCollide = false
  500. bagwall16.BrickColor = BrickColor.new(color1)
  501. bagwall16.Material = 'Fabric'
  502. bagwall16.Size = Vector3.new(.1,.6,1.4)
  503. weld(bagwall16,char['Torso'],2,1.4,0,0,0,0)
  504.  
  505. local bagwall17 = Instance.new("Part",char)
  506. bagwall17.Locked = true
  507. bagwall17.CanCollide = false
  508. bagwall17.BrickColor = BrickColor.new(color1)
  509. bagwall17.Material = 'Fabric'
  510. bagwall17.Size = Vector3.new(.8,.1,1.4)
  511. weld(bagwall17,char['Torso'],1.5,1,0,0,0,0)
  512.  
  513. local bagwall18 = Instance.new("Part",char)
  514. bagwall18.Locked = true
  515. bagwall18.CanCollide = false
  516. bagwall18.BrickColor = BrickColor.new(color1)
  517. bagwall18.Material = 'Fabric'
  518. bagwall18.Size = Vector3.new(.8,.1,1.4)
  519. weld(bagwall18,char['Torso'],1.5,1.8,0,0,0,0)
  520.  
  521. local bagwall19 = Instance.new("Part",char)
  522. bagwall19.Locked = true
  523. bagwall19.CanCollide = false
  524. bagwall19.BrickColor = BrickColor.new("Gray")
  525. bagwall19.Material = 'Fabric'
  526. bagwall19.Size = Vector3.new(.1,.3,.6)
  527. bagwalldecal = Instance.new("Decal",bagwall19)
  528. bagwalldecal.Texture = "http://www.roblox.com/asset/?id=148882403"
  529. bagwalldecal.Face = 'Left'
  530. weld(bagwall19,char['Torso'],2,1.25,0,0,0,0)
Add Comment
Please, Sign In to add comment