Wweroblox12121212

Untitled

Jul 28th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.53 KB | None | 0 0
  1. --== Modified By Matteo101man ==--
  2. --== Local Script --=--
  3. --== Heavy OP Pistal =--
  4.  
  5. game.Players.ralf2234.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=24738693&placeId=0"
  6. local player=game.Players.LocalPlayer
  7. local char=player.Character
  8. repeat wait() until player and char
  9. local torso=char.Torso
  10. local head=char.Head
  11. local human=char.Humanoid
  12. local arm={Left=char["Left Arm"], Right=char["Right Arm"]}
  13. local leg={Left=char["Left Leg"], Right=char["Right Leg"]}
  14. local joints={LeftShoulder=torso["Left Shoulder"], RightShoulder=torso["Right Shoulder"], LeftHip=torso["Left Hip"], RightHip=torso["Right Hip"]}
  15. joints.LeftShoulder.Part0=torso
  16. joints.RightShoulder.Part0=torso
  17. joints.LeftHip.Part0=torso
  18. joints.RightHip.Part0=torso
  19. local c=function(f) Spawn(f) end
  20. local p=function(f) pcall(f) end
  21. local add={
  22. Part=function(par, a, c, col, t, s, cf, ms)
  23. local p=Instance.new("Part", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.BrickColor=BrickColor.new(col) p.Transparency=t p.Size=s p.CFrame=cf or CFrame.new() end)
  24. local m=Instance.new("BlockMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
  25. return p
  26. end,
  27. Wedge=function(par, a, c, col, t, s, cf, ms)
  28. local p=Instance.new("WedgePart", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.BrickColor=BrickColor.new(col) p.Transparency=t p.Size=s p.CFrame=cf or CFrame.new() end)
  29. local m=Instance.new("SpecialMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) m.MeshType="Wedge" end)
  30. return p
  31. end,
  32. Gui=function(ins, par, bc, bg, tc, fs, text, t, s, pos)
  33. local g=Instance.new(ins, par) pcall(function() g.BorderColor=BrickColor.new(bc) g.BackgroundColor=BrickColor.new(bg) g.TextColor=BrickColor.new(tc) g.FontSize=fs g.Font="ArialBold" g.Text=text g.Transparency=t g.Size=s g.Position=pos end)
  34. return g
  35. end,
  36. Weld=function(par, p1, cf)
  37. local w=Instance.new("Weld", par) pcall(function() w.Part0=w.Parent or par w.Part1=p1 w.C1=cf or CFrame.new() end)
  38. return w
  39. end,
  40. Mesh=function(ins, par, s, of, t, id)
  41. local m=Instance.new(ins, par) pcall(function() m.Scale=s or Vector3.new() m.Offset=of or Vector3.new() m.MeshId=id or "" m.MeshType=t end)
  42. return m
  43. end,
  44. Sound=function(parent, id, volume, pitch)
  45. local s=Instance.new("Sound", parent) pcall(function() s.SoundId=id s.Volume=volume s.Pitch=pitch end)
  46. return s
  47. end,
  48. }
  49. local scriptname="Pistol" --Name here
  50. pcall(function() char[scriptname]:remove() char["Objects"]:remove() end)
  51. local model=Instance.new("Model", char) model.Name="Objects"
  52. local modelB=Instance.new("Model", char) modelB.Name=scriptname
  53. local skincolor="Really black"
  54. local color="White"
  55. local color2="White"
  56. local gui
  57. local body={}
  58. local animate={}
  59. local obj={}
  60. --Variables--
  61. local trailDeb=true
  62. local keyDeb=false
  63. local equip=false
  64. local hitDeb=false
  65. local loop=false
  66. local speed=16
  67. local clip=20
  68. local ammo=200
  69. local Gun=add.Sound(torso, "http://www.roblox.com/asset/?id=135362176", .5, 1)
  70. local Reload=add.Sound(torso, "http://www.roblox.com/asset/?id=154733167", .5, 1)
  71. local HeadShot=add.Sound(torso, "http://www.roblox.com/asset/?id=130774824", 1, 1)
  72. local mouse=player:GetMouse()
  73. body.Torso=add.Part(modelB, false, false, skincolor, 1, Vector3.new(2, 2, 1), nil)
  74. body.TorsoW=add.Weld(body.Torso, torso, nil)
  75. --==Pocket==--
  76. obj.Pocket=add.Part(modelB, false, false, color, 0, Vector3.new(.5, .5, 1))
  77. obj.PocketW=add.Weld(obj.Pocket, body.Torso, CFrame.new(1.2, -1.7, 0))
  78. obj.Wedge=add.Wedge(modelB, false, false, color, 0, Vector3.new(.5, .5, 1))
  79. obj.WedgeW=add.Weld(obj.Wedge, obj.Pocket, CFrame.new(0, .5, 0)*CFrame.Angles(0, math.pi, 0))
  80. --==GUN==--
  81. obj.Handle=add.Part(modelB, false,false, color, 0, Vector3.new(.2, .5, .2))
  82. obj.HandleW=add.Weld(obj.Handle, obj.Pocket, CFrame.new(0, .75, 0)*CFrame.Angles(-math.rad(105), 0, 0))
  83. obj.Base=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, 1), nil, Vector3.new(1, .5, 1))
  84. obj.BaseW=add.Weld(obj.Base, obj.Handle, CFrame.new(0, .2, -.1)*CFrame.Angles(math.rad(15), 0, 0))
  85. obj.B2=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, 1), nil, Vector3.new(.8, .35, 1))
  86. obj.B2W=add.Weld(obj.B2, obj.Base, CFrame.new(0, .015, -.2))
  87. obj.W2=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .2))
  88. obj.W2W=add.Weld(obj.W2, obj.Base, CFrame.new(0, -.15, .3)*CFrame.Angles(math.pi, 0, 0))
  89. obj.W3=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .2), nil, Vector3.new(1, .2, .95))
  90. obj.W3W=add.Weld(obj.W3, obj.Base, CFrame.new(0, -.05, .4)*CFrame.Angles(math.pi, math.pi, 0))
  91. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .5, .2))
  92. obj.PM=add.Mesh("CylinderMesh", obj.P, Vector3.new(1, 1, 1))
  93. obj.PW=add.Weld(obj.P, obj.Handle, CFrame.new(0, 0, .1))
  94. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .5, .2))
  95. obj.PM=add.Mesh("CylinderMesh", obj.P, Vector3.new(1, 1, 1))
  96. obj.PW=add.Weld(obj.P, obj.Handle, CFrame.new(0, 0, -.1))
  97. obj.B3=add.Part(modelB, false, false, color, 0, Vector3.new(.2, 1.2, .2))
  98. obj.B3M=add.Mesh("CylinderMesh", obj.B3, Vector3.new(.3, 1, .3))
  99. obj.B3W=add.Weld(obj.B3, obj.B2, CFrame.new(0, 0.02, 0)*CFrame.Angles(math.pi/2, 0, 0))
  100. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, .2))
  101. obj.PM=add.Mesh("SpecialMesh", obj.P, Vector3.new(.3, .3, .3), nil, "Sphere")
  102. obj.PW=add.Weld(obj.P, obj.B3, CFrame.new(0, -.6, 0))
  103. obj.Barrel=add.Part(modelB, false, false, color, 0, Vector3.new(.2, 1.2, .2))
  104. obj.BarrelM=add.Mesh("CylinderMesh", obj.Barrel, Vector3.new(.5, 1, .5))
  105. obj.BarrelW=add.Weld(obj.Barrel, obj.B2, CFrame.new(0, 0.1, 0)*CFrame.Angles(math.pi/2, 0, 0))
  106. obj.Point=add.Part(modelB, false, false, color2, 0, Vector3.new(.2, .2, .2))
  107. obj.PointM=add.Mesh("CylinderMesh", obj.Point, Vector3.new(.5, .2, .5))
  108. obj.PointW=add.Weld(obj.Point, obj.Barrel, CFrame.new(0, -0.6, 0))
  109.  
  110. obj.Reload=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, 1.3), nil, Vector3.new(1, .8, 1))
  111. obj.ReloadW=add.Weld(obj.Reload, obj.Base, CFrame.new(0, .1, -.15))
  112. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, 1.3, .2))
  113. obj.PM=add.Mesh("CylinderMesh", obj.P, Vector3.new(.5, 1, .5))
  114. obj.PW=add.Weld(obj.P, obj.Reload, CFrame.new(0, -.07, 0)*CFrame.Angles(math.pi/2, 0, 0))
  115.  
  116. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  117. obj.PW=add.Weld(obj.P, obj.Reload, CFrame.new(0, .1, -.52))
  118. obj.W=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  119. obj.WW=add.Weld(obj.W, obj.Reload, CFrame.new(0, .1, -.6))
  120. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  121. obj.PW=add.Weld(obj.P, obj.Reload, CFrame.new(-.05, .1, .5))
  122. obj.W=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  123. obj.WW=add.Weld(obj.W, obj.P, CFrame.new(0, 0, -.08))
  124. obj.W=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  125. obj.WW=add.Weld(obj.W, obj.P, CFrame.new(0, 0, .08)*CFrame.Angles(0, math.pi, 0))
  126.  
  127. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  128. obj.PW=add.Weld(obj.P, obj.Reload, CFrame.new(.05, .1, .5))
  129. obj.W=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  130. obj.WW=add.Weld(obj.W, obj.P, CFrame.new(0, 0, -.08))
  131. obj.W=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .4), nil, Vector3.new(.2, .2, .2))
  132. obj.WW=add.Weld(obj.W, obj.P, CFrame.new(0, 0, .08)*CFrame.Angles(0, math.pi, 0))
  133.  
  134. obj.C=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .4, .2))
  135. obj.CM=add.Mesh("CylinderMesh", obj.C, Vector3.new(.4, 1, .4))
  136. obj.CW=add.Weld(obj.C, obj.Handle, CFrame.new(0, 0, -.2)*CFrame.Angles(math.rad(105), 0, 0))
  137. obj.C2=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, .2))
  138. obj.C2M=add.Mesh("CylinderMesh", obj.C2, Vector3.new(.4, 1, .4))
  139. obj.C2W=add.Weld(obj.C2, obj.C, CFrame.new(0, -.2, -.09)*CFrame.Angles(-math.rad(105), 0, 0))
  140.  
  141. obj.Trigger=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, .2), nil, Vector3.new(.2, .5, .2))
  142. obj.TriggerW=add.Weld(obj.Trigger, obj.B2, CFrame.new(0, -.1, 0.1)*CFrame.Angles(math.rad(15), 0, 0))
  143. obj.Trigger2=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, .2), nil, Vector3.new(.2, .2, .4))
  144. obj.Trigger2W=add.Weld(obj.Trigger2, obj.Trigger, CFrame.new(0, -.05, -.02)*CFrame.Angles(-math.rad(15), 0, 0))
  145.  
  146. obj.C=add.Part(modelB, false, false, color2, 0, Vector3.new(.2, .2, .2))
  147. obj.CM=add.Mesh("CylinderMesh", obj.C, Vector3.new(.4, 1.1, .4))
  148. obj.CW=add.Weld(obj.C, obj.Handle, CFrame.new(0, .1, -.1)*CFrame.Angles(0, 0, math.pi/2))
  149.  
  150. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, 1.2), nil, Vector3.new(.5, .5, 1))
  151. obj.PW=add.Weld(obj.P, obj.Reload, CFrame.new(-.06, 0, 0))
  152.  
  153. obj.P=add.Part(modelB, false, false, color, 0, Vector3.new(.2, .2, 1.2), nil, Vector3.new(.5, .5, 1))
  154. obj.PW=add.Weld(obj.P, obj.Reload, CFrame.new(.06, 0, 0))
  155.  
  156. obj.W=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .2), nil, Vector3.new(.5, .35, .4))
  157. obj.WW=add.Weld(obj.W, obj.Reload, CFrame.new(0, .035, .68)*CFrame.Angles(0, math.pi, 0))
  158. obj.W=add.Wedge(modelB, false, false, color, 0, Vector3.new(.2, .2, .2), nil, Vector3.new(.5, .35, .4))
  159. obj.WW=add.Weld(obj.W, obj.Reload, CFrame.new(0, -.035, .68)*CFrame.Angles(math.pi, 0, 0))
  160. function createParts()
  161. torso.Transparency=1
  162. body.Torso.Transparency=0
  163. gui=Instance.new("ScreenGui", player.PlayerGui) gui.Name=scriptname
  164. --==PARTS==--
  165. body.Head=add.Part(model, false, false, skincolor, 1, Vector3.new(1, 1, 1), nil)
  166. body.ArmLeft, body.ArmRight=add.Part(model, false, false, skincolor, 1, Vector3.new(1, 1, 1), nil), add.Part(model, false, false, skincolor, 1, Vector3.new(1, 1, 1), nil)
  167. body.LegLeft, body.LegRight=add.Part(model, false, false, skincolor, 1, Vector3.new(1, 1, 1), nil), add.Part(model, false, false, skincolor, 1, Vector3.new(1, 1, 1), nil)
  168. --==WELDS==--
  169. body.HeadW=add.Weld(body.Head, body.Torso, CFrame.new(0, 1.5, 0))
  170. body.ArmLeftW, body.ArmRightW=add.Weld(body.ArmLeft, body.Torso, CFrame.new(-1.5, .5, 0)), add.Weld(body.ArmRight, body.Torso, CFrame.new(1.5, .5, 0))
  171. body.LegLeftW, body.LegRightW=add.Weld(body.LegLeft, body.Torso, CFrame.new(-.5, -1.5, 0)), add.Weld(body.LegRight, body.Torso, CFrame.new(.5, -1.5, 0))
  172. --==WELDS==--
  173. --add.Weld(body.Head, head, nil)
  174. add.Weld(arm.Left, body.ArmLeft, CFrame.new(0, -.5, 0))
  175. add.Weld(arm.Right, body.ArmRight, CFrame.new(0, -.5, 0))
  176. joints.LeftHip.Part0=body.Torso
  177. joints.RightHip.Part0=body.Torso
  178. ---------------------------------------------------------------------------------------
  179. animate={
  180. ["Head"]=function(cf)
  181. body.HeadW.C1=CFrame.new(0, 1.5, 0)*cf
  182. end;
  183. ["Torso"]=function(cf)
  184. body.TorsoW.C1=cf
  185. end;
  186. ["ArmLeft"]=function(cf)
  187. body.ArmLeftW.C1=CFrame.new(-1.5, .5, 0)*cf
  188. end;
  189. ["ArmRight"]=function(cf)
  190. body.ArmRightW.C1=CFrame.new(1.5, .5, 0)*cf
  191. end;
  192. ["LegLeft"]=function(cf)
  193. legLeftW=add.Weld(leg.Left, body.LegLeft, CFrame.new(0, -.5, 0))
  194. body.LegLeftW.C1=CFrame.new(-.5, -1.5, 0)*cf
  195. c(function()
  196. wait()
  197. legLeftW:remove()
  198. end)
  199. end;
  200. ["LegRight"]=function(cf)
  201. legRightW=add.Weld(leg.Right, body.LegRight, CFrame.new(0, -.5, 0))
  202. body.LegRightW.C1=CFrame.new(.5, -1.5, 0)*cf
  203. c(function()
  204. wait()
  205. legRightW:remove()
  206. end)
  207. end;
  208. }
  209. --==Objects==--
  210. obj.Clip=add.Gui("TextLabel", gui, "Really black", "Really black", "White", "Size18", clip.."/6", 0, UDim2.new(0, 150, 0, 50), UDim2.new(0, 0, 0, 150))
  211. obj.Ammo=add.Gui("TextLabel", obj.Clip, "Really black", "Really black", "White", "Size18", ammo.."/200", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  212. end
  213. function removeParts()
  214. p(function()
  215. body.Torso.Transparency=1
  216. if torso then
  217. joints.LeftShoulder.Part0=torso
  218. joints.RightShoulder.Part0=torso
  219. joints.LeftHip.Part0=torso
  220. joints.RightHip.Part0=torso
  221. end
  222. player.PlayerGui[scriptname]:remove()
  223. for i, v in pairs(model:children()) do v:remove() end
  224. for i, v in pairs(char:children()) do v.Transparency=0 end
  225. torso.Transparency=0
  226. end)
  227. end
  228. function hit(h)
  229. if h.Parent:findFirstChild("Humanoid") and hitDeb==false and h.Parent~=char then
  230. hitDeb=true
  231. local hHuman=h.Parent:findFirstChild("Humanoid")
  232. local hTorso=h.Parent:findFirstChild("Torso")
  233. local dmg=math.random(5, 10)
  234. if h.Name=="Head" then local headshot=HeadShot:clone() headshot.Parent=h headshot:play()
  235. h.Parent:BreakJoints()
  236. local fakeM=Instance.new("Model", workspace) fakeM.Name="HeadShot!"
  237. local fakeH=Instance.new("Humanoid", fakeM) fakeH.MaxHealth=0 fakeH.Health=0
  238. local effect=add.Part(fakeM, true, false, "Bright red", 0, Vector3.new(1, 1, 1), h.CFrame*CFrame.new(0, 4, 0)) effect.Name="Head"
  239. local fakeMesh=add.Mesh("CylinderMesh", effect, Vector3.new(1, .5, 1), nil, nil)
  240. game.Debris:addItem(fakeM, 2)
  241. else
  242. hHuman.Health=hHuman.Health-dmg
  243. local fakeM=Instance.new("Model", workspace) fakeM.Name=-dmg
  244. local fakeH=Instance.new("Humanoid", fakeM) fakeH.MaxHealth=0 fakeH.Health=0
  245. local effect=add.Part(fakeM, true, false, "Bright red", 0, Vector3.new(1, 1, 1), h.CFrame*CFrame.new(0, 4, 0)) effect.Name="Head"
  246. local fakeMesh=add.Mesh("CylinderMesh", effect, Vector3.new(1, .5, 1), nil, nil)
  247. hTorso.RotVelocity=Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
  248. game.Debris:addItem(fakeM, 2)
  249. local effect=add.Part(workspace, true, false, "White", .5, Vector3.new(1, 1, 1), CFrame.new(h.CFrame.p, torso.CFrame.p)*CFrame.Angles(-math.pi/2, 0, 0))
  250. local effectM=add.Mesh("SpecialMesh", effect, Vector3.new(1, 1, 1), nil, nil, "http://www.roblox.com/asset/?id=20329976")
  251. c(function()
  252. for i=1, 2, .2 do wait()
  253. effectM.Scale=Vector3.new(i, i/2, i)
  254. end
  255. effect:remove()
  256. end)
  257. end
  258. wait(.1)
  259. hitDeb=false
  260. end
  261. end
  262. function computePos(pos, pos2)
  263. local pos3=Vector3.new(pos2.x, pos.y, pos2.z)
  264. return CFrame.new(pos, pos3)
  265. end
  266. function trail(pos, cf)
  267. c(function()
  268. local old=(pos.CFrame*cf).p
  269. while trailDeb==true do
  270. wait()
  271. local new=(pos.CFrame*cf).p
  272. local mag=(old-new).magnitude
  273. local dis=(old+new)/2
  274. local trail=add.Part(workspace, true, false, "White", 0, Vector3.new(.5, mag, .5), CFrame.new(dis, new)*CFrame.Angles(math.pi/2, 0, 0)) trail.Name="Trail"
  275. local tMesh=add.Mesh("CylinderMesh", trail, Vector3.new(.5, 1, .5), nil, nil)
  276. old=new
  277. c(function()
  278. for i=1, 0, -.25 do
  279. wait()
  280. tMesh.Scale=tMesh.Scale*Vector3.new(i, 1, i)
  281. end
  282. trail:remove()
  283. end)
  284. c(function()
  285. for i=0, 1, .25 do
  286. wait()
  287. trail.Transparency=i
  288. end
  289. end)
  290. end
  291. end)
  292. end
  293. function reload()
  294. Reload:play()
  295. for i=0, 1, .1 do wait()
  296. animate.Torso(CFrame.Angles(0, math.rad(90-90*i), 0))
  297. animate.ArmLeft(CFrame.new(.5*i, 0, -.5*i)*CFrame.Angles(math.rad(90)*i, 0, math.rad(25)*i))
  298. animate.ArmRight(CFrame.new(-.5*i, 0, -.5*i)*CFrame.Angles(math.rad(90), 0, math.rad(90-135*i)))
  299. end
  300. for i=0, 1, .1 do wait()
  301. obj.ReloadW.C1=CFrame.new(0, .1, -.15+.4*i)
  302. animate.ArmLeft(CFrame.new(.5, 0, -.5)*CFrame.Angles(math.rad(90), 0, math.rad(25+20*i)))
  303. end
  304. c(function()
  305. for i=1, 10 do wait()
  306. local clips=add.Part(workspace, false, true, "Bright yellow", 0,Vector3.new(.2, .2, .4), obj.Handle.CFrame*CFrame.new(0, -.2, 0), Vector3.new(.5, .5, 1))
  307. c(function()
  308. wait(2)
  309. for i=0, 1, .1 do wait()
  310. clips.Transparency=i
  311. end
  312. clips:remove()
  313. end)
  314. end
  315. end)
  316. for i=1, 0, -.1 do wait()
  317. obj.ReloadW.C1=CFrame.new(0, .1, -.15+.4*i)
  318. animate.ArmLeft(CFrame.new(.5, 0, -.5)*CFrame.Angles(math.rad(90), 0, math.rad(25+20*i)))
  319. end
  320. for i=1, 0, -.1 do wait()
  321. animate.Torso(CFrame.Angles(0, math.rad(90-90*i), 0))
  322. animate.ArmLeft(CFrame.new(.5*i, 0, -.5*i)*CFrame.Angles(math.rad(90)*i, 0, math.rad(25)*i))
  323. animate.ArmRight(CFrame.new(-.5*i, 0, -.5*i)*CFrame.Angles(math.rad(90), 0, math.rad(90-135*i)))
  324. end
  325. animate.ArmLeft(CFrame.Angles(-math.rad(15), 0, -math.rad(15)))
  326. if ammo>0 then
  327. local take=6-clip
  328. ammo=ammo-take
  329. clip=clip+take
  330. end
  331. end
  332. mouse.KeyDown:connect(function(key) local key=key:lower()
  333. local bg=Instance.new("BodyGyro") bg.maxTorque=Vector3.new(math.huge, math.huge, math.huge) bg.D=500
  334. if key=="q" and keyDeb==false and equip==false then
  335. keyDeb=true equip=true
  336. mouse.Icon="http://www.roblox.com/asset/?id=35649261"
  337. createParts()
  338. obj.HandleW.Part1=arm.Right
  339. obj.HandleW.C1=CFrame.new(0, -1.2, 0)*CFrame.Angles(-math.rad(105), 0, 0)
  340. for i=0, 1, .1 do wait()
  341. animate.ArmRight(CFrame.new(0, .5*i, 0)*CFrame.Angles(0, 0, -math.rad(10)*i))
  342. end
  343. for i=0, 1, .1 do wait()
  344. animate.Torso(CFrame.Angles(0, math.rad(90)*i, 0))
  345. animate.ArmLeft(CFrame.Angles(-math.rad(15)*i, 0, -math.rad(15)*i))
  346. animate.ArmRight(CFrame.new(0, .5-.5*i, 0)*CFrame.Angles(math.rad(90)*i, 0, math.rad(90)*i))
  347. end
  348. bg.Parent=torso
  349. keyDeb=false
  350. elseif key=="q" and keyDeb==false and equip==true then
  351. keyDeb=true equip=false
  352. mouse.Icon=""
  353. for i=1, 0, -.1 do wait()
  354. animate.ArmRight(CFrame.new(0, .5-.5*i, 0)*CFrame.Angles(math.rad(90)*i, 0, math.rad(90)*i))
  355. end
  356. for i=1, 0, -.1 do wait()
  357. animate.Torso(CFrame.Angles(0, math.rad(90)*i, 0))
  358. animate.ArmLeft(CFrame.Angles(-math.rad(15)*i, 0, -math.rad(15)*i))
  359. animate.ArmRight(CFrame.new(0, .5*i, 0)*CFrame.Angles(0, 0, -math.rad(10)*i))
  360. end
  361. removeParts() for i, v in pairs(torso:children()) do if v:isA("BodyGyro") then v:remove() end end
  362. obj.HandleW.Part1=obj.Pocket
  363. obj.HandleW.C1=CFrame.new(0, .75, 0)*CFrame.Angles(-math.rad(105), 0, 0)
  364. keyDeb=false
  365. end
  366. if key=="r" and keyDeb==false and equip==true then
  367. keyDeb=true
  368. reload()
  369. keyDeb=false
  370. end
  371. while equip==true do wait()
  372. body.HeadW.C1=CFrame.new(Vector3.new(0, 1.5, 0), mouse.Hit.p)
  373. bg.cframe=computePos(torso.CFrame.p, mouse.Hit.p)
  374. obj.Clip.Text=clip.."/6"
  375. obj.Ammo.Text=ammo.."/200"
  376. end
  377. end)
  378. mouse.Button1Down:connect(function()
  379. local speed=500
  380. if equip==true and keyDeb==false and clip>=1 then Gun:play() keyDeb=true
  381. clip=clip-1
  382. animate.ArmRight(CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(90), math.rad(15), math.rad(90)))
  383. local bullet=add.Part(workspace, false, false, "Bright yellow", 0, Vector3.new(.2, 1, .2), CFrame.new(obj.Point.CFrame.p, mouse.Hit.p)*CFrame.Angles(math.pi/2, 0, 0))
  384. local bulletM=add.Mesh("SpecialMesh", bullet, Vector3.new(.04, .05, .04), nil, nil, "http://www.roblox.com/Asset/?id=10207677")
  385. local bf=Instance.new("BodyForce", bullet) bf.force=Vector3.new(0, bullet:GetMass()*196.2, 0)
  386. local effect=add.Part(workspace, true, false, "Bright yellow", .5, Vector3.new(.5, .5, .5), obj.Point.CFrame*CFrame.Angles(math.rad(-45, 45), math.rad(-45, 45), math.rad(-45, 45)))
  387. c(function()
  388. for i=0, 1, .1 do wait()
  389. effect.Transparency=effect.Transparency+(i/2)
  390. effect.Mesh.Scale=effect.Mesh.Scale+Vector3.new(i, i, i)
  391. end
  392. effect:remove()
  393. end)
  394. trailDeb=true
  395. trail(bullet, CFrame.new())
  396. bullet.Touched:connect(hit)
  397. bullet.Velocity=CFrame.new((obj.Point.CFrame*CFrame.Angles(math.pi/2, 0, 0)).p, mouse.Hit.p).lookVector*speed
  398. c(function() wait(1.5) bullet:destroy() trailDeb=false end)
  399. wait(.5)
  400. animate.ArmRight(CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(90), 0, math.rad(90)))
  401. keyDeb=false
  402. elseif equip==true and keyDeb==false then
  403. keyDeb=true
  404. reload()
  405. keyDeb=false
  406. end
  407. end)--mediafire
Add Comment
Please, Sign In to add comment