Facebook
From Billwa, 9 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 434
  1. ak47 = Instance.new("Tool")
  2. ak47.Parent = game.Players.meunumbertwo.Backpack
  3. ak47.GripPos = Vector3.new(-0,-0.10000000149012,0.69999998807907)
  4. ak47.Grip = CFrame.new(-0,-0.10000000149012,0.69999998807907) * CFrame.Angles(-9.9999997171807e-010, -1.0000000133514e-010, 1.0000912714276e-015)
  5. ak47.GripForward = Vector3.new(1.0000000133514e-010,-9.9999997171807e-010,-1)
  6. ak47.Name = "AK47"
  7. ak47.GripRight = Vector3.new(1,1.0001912213153e-015,1.0000000133514e-010)
  8. ak47.GripUp = Vector3.new(-1.0000912714276e-015,1,-9.9999997171807e-010)
  9.  
  10. handle = Instance.new("Part",ak47)
  11. handle.FormFactor = Enum.FormFactor.Plate
  12. handle.TopSurface = Enum.SurfaceType.Smooth
  13. handle.Size = Vector3.new(1,2,5)
  14. handle.Name = "Handle"
  15. handle.CFrame = CFrame.new(-25.213916778564,0.48495537042618,-61.464176177979) * CFrame.Angles(-0.024566793814301, -1.4979313611984, 1.5458176136017)
  16. handle.BrickColor = BrickColor.new("Black")
  17. handle.Friction = 0.30000001192093
  18. handle.BottomSurface = Enum.SurfaceType.Smooth
  19.  
  20. mesh = Instance.new("SpecialMesh",handle)
  21. mesh.Scale = Vector3.new(2,1.5,1.5)
  22. mesh.MeshId = "http://www.roblox.com/asset/?id=3824749"
  23. mesh.TextureId = "http://www.roblox.com/asset/?id=3824746"
  24. mesh.VertexColor = Vector3.new(0.40000000596046,0.40000000596046,0.40000000596046)
  25. mesh.MeshType = Enum.MeshType.FileMesh
  26.  
  27. Tool = ak47;
  28. local arms = nil
  29. local torso = nil
  30. local welds = {}
  31.  
  32. function Equip(mouse)
  33. wait(0.01)
  34. arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
  35. torso = Tool.Parent:FindFirstChild("Torso")
  36. if arms ~= nil and torso ~= nil then
  37. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  38. if sh ~= nil then
  39. local yes = true
  40. if yes then
  41. yes = false
  42. sh[1].Part1 = nil
  43. sh[2].Part1 = nil
  44. local weld1 = Instance.new("Weld")
  45. weld1.Part0 = torso
  46. weld1.Parent = torso
  47. weld1.Part1 = arms[1]
  48. weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  49. welds[1] = weld1
  50. local weld2 = Instance.new("Weld")
  51. weld2.Part0 = torso
  52. weld2.Parent = torso
  53. weld2.Part1 = arms[2]
  54. weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  55. welds[2] = weld2
  56. end
  57. else
  58. print("sh")
  59. end
  60. else
  61. print("arms")
  62. end
  63. end
  64.  
  65. function Unequip(mouse)
  66. if arms ~= nil and torso ~= nil then
  67. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  68. if sh ~= nil then
  69. local yes = true
  70. if yes then
  71. yes = false
  72. sh[1].Part1 = arms[1]
  73. sh[2].Part1 = arms[2]
  74. welds[1].Parent = nil
  75. welds[2].Parent = nil
  76. end
  77. else
  78. print("sh")
  79. end
  80. else
  81. print("arms")
  82. end
  83. end
  84. Tool.Equipped:connect(Equip)
  85. Tool.Unequipped:connect(Unequip)
  86.  
  87. local Tool = script.Parent;
  88.  
  89. enabled = true
  90. function onButton1Down(mouse)
  91.         if not enabled then
  92.                 return
  93.         end
  94.  
  95.         enabled = true
  96.         mouse.Icon = "rbxasset://textures\\GunCursor.png"
  97.  
  98.         --wait(.5)
  99.         --mouse.Icon = "rbxasset://textures\\GunCursor.png"
  100.         --enabled = true
  101.         --mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  102.  
  103. end
  104.  
  105.  
  106. function onButton1Up(mouse)
  107. enabled = false
  108. Tool.Enabled = false
  109. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  110. wait(1)
  111. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  112. enabled = true
  113. Tool.Enabled = true
  114. end
  115.  
  116. function onEquippedLocal(mouse)
  117.  
  118.         if mouse == nil then
  119.                 print("Mouse not found")
  120.                 return
  121.         end
  122.  
  123.         mouse.Icon = "rbxasset://textures\\GunCursor.png"
  124.         mouse.Button1Down:connect(function() onButton1Down(mouse) end) 
  125.         mouse.Button1Up:connect(function() onButton1Up(mouse)end)
  126. end
  127.  
  128.  
  129. Tool.Equipped:connect(onEquippedLocal)