Advertisement
HenloMyDude

gun

Sep 12th, 2019
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. Weld2 = Instance.new("Weld")
  22. Part3 = Instance.new("Part")
  23. Script4 = Instance.new("Script")
  24. Animation5 = Instance.new("Animation")
  25. Tool0.Name = "Pistol"
  26. Tool0.Parent = mas
  27. Tool0.Grip = CFrame.new(0.143165588, -0.257258415, -0.278945893, -4.37113883e-08, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-08)
  28. Tool0.GripForward = Vector3.new(-1, -0, 4.37113883e-08)
  29. Tool0.GripPos = Vector3.new(0.143165588, -0.257258415, -0.278945893)
  30. Tool0.GripRight = Vector3.new(-4.37113883e-08, 0, -1)
  31. Part1.Name = "Handle"
  32. Part1.Parent = Tool0
  33. Part1.CFrame = CFrame.new(-132.471054, 5.25725651, -115.356834, 4.37113847e-08, 0, 0.999999821, -4.37113883e-08, 1, 1.91068504e-15, -1, -4.37113883e-08, 4.37113812e-08)
  34. Part1.Orientation = Vector3.new(0, 90, 0)
  35. Part1.Position = Vector3.new(-132.471054, 5.25725651, -115.356834)
  36. Part1.Rotation = Vector3.new(0, 89.9700012, 0)
  37. Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
  38. Part1.Size = Vector3.new(0.74999994, 1.49999988, 0.74999994)
  39. Part1.BottomSurface = Enum.SurfaceType.Smooth
  40. Part1.BrickColor = BrickColor.new("Black")
  41. Part1.brickColor = BrickColor.new("Black")
  42. Weld2.Name = "BTWeld"
  43. Weld2.Parent = Part1
  44. Weld2.C1 = CFrame.new(-0.37500006, -1.12499988, 0, -4.37113883e-08, 1, 0, -1, -4.37113883e-08, 0, 0, 0, 0.99999994)
  45. Weld2.Part0 = Part1
  46. Weld2.Part1 = Part3
  47. Weld2.part1 = Part3
  48. Part3.Name = "bulletpos"
  49. Part3.Parent = Tool0
  50. Part3.CFrame = CFrame.new(-132.471054, 5.63225651, -114.231834, -1.91068525e-15, -4.37113847e-08, 0.999999881, 1, 0, 1.91068525e-15, 0, 1, 4.37113847e-08)
  51. Part3.Orientation = Vector3.new(0, 90, 90)
  52. Part3.Position = Vector3.new(-132.471054, 5.63225651, -114.231834)
  53. Part3.Rotation = Vector3.new(0, 89.9700012, 90)
  54. Part3.Color = Color3.new(0.105882, 0.164706, 0.207843)
  55. Part3.Size = Vector3.new(0.56249994, 1.49999988, 0.74999994)
  56. Part3.BottomSurface = Enum.SurfaceType.Smooth
  57. Part3.BrickColor = BrickColor.new("Black")
  58. Part3.brickColor = BrickColor.new("Black")
  59. Script4.Name = "Shoot"
  60. Script4.Parent = Tool0
  61. table.insert(cors,sandbox(Script4,function()
  62. wait(.5)
  63. if script.Parent.Name == "Pistol" then
  64. Tool = script.Parent
  65. Handle = Tool.Handle
  66. Debris = game:GetService("Debris")
  67.  
  68. function NewBullet(Position, Velocity, Parent)
  69. local Bullet = Instance.new("Part",Parent)
  70. Bullet.Position = Position
  71. Bullet.CanCollide = false
  72. Bullet.Material = "SmoothPlastic"
  73. Bullet.Size = Vector3.new(0.5, 0.5, 1.75)
  74. Bullet.Anchored = false
  75. Bullet.Orientation = Tool.Parent.HumanoidRootPart.Orientation
  76. local Hitter = Bullet.Touched:connect(function(hit)
  77. local Player = hit.Parent
  78. for i,Humanoid in pairs (Player:GetChildren()) do
  79. if Humanoid:IsA("Humanoid") and Humanoid.Parent ~= Tool.Parent then
  80. Humanoid.Health = Humanoid.Health - 15
  81. Bullet:Destroy()
  82. end
  83. end
  84. end)
  85. local BV = Instance.new("BodyVelocity",Bullet)
  86. BV.Velocity = Bullet.CFrame.lookVector * Velocity
  87. Debris:AddItem(Bullet, 15)
  88. return Bullet
  89. end
  90.  
  91. function Activated()
  92. Tool.Enabled = false
  93. local toolanim = Instance.new("StringValue",Tool)
  94. toolanim.Name = "toolanim"
  95. toolanim.Value = "Lunge"
  96. end
  97.  
  98. Tool.Activated:connect(function()
  99. Activated()
  100. local Uuf = NewBullet(Tool.bulletpos.Position, 50, workspace)
  101. end)
  102. end
  103. end))
  104. Animation5.Parent = Tool0
  105. for i,v in pairs(mas:GetChildren()) do
  106. v.Parent = owner.Backpack
  107. pcall(function() v:MakeJoints() end)
  108. end
  109. mas:Destroy()
  110. for i,v in pairs(cors) do
  111. spawn(function()
  112. pcall(v)
  113. end)
  114. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement