Advertisement
vibrantsinger423

gun test

Apr 1st, 2018
1,800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.42 KB | None | 0 0
  1. wait(0.2)
  2. Player = game:GetService("Players").LocalPlayer
  3. PlayerGui = Player.PlayerGui
  4. Cam = workspace.CurrentCamera
  5. Backpack = Player.Backpack
  6. Character = Player.Character
  7. Humanoid = Character.Humanoid
  8. Mouse = Player:GetMouse()
  9. RootPart = Character.HumanoidRootPart
  10. Torso = Character.Torso
  11. Head = Character.Head
  12. RightArm = Character["Right Arm"]
  13. LeftArm = Character["Left Arm"]
  14. RightLeg = Character["Right Leg"]
  15. LeftLeg = Character["Left Leg"]
  16. RootJoint = RootPart.RootJoint
  17. Neck = Torso.Neck
  18. RightShoulder = Torso["Right Shoulder"]
  19. LeftShoulder = Torso["Left Shoulder"]
  20. RightHip = Torso["Right Hip"]
  21. LeftHip = Torso["Left Hip"]
  22. local LastBolt
  23. local LightningBolts = {}
  24. local GunPoint
  25. IT = Instance.new
  26. CF = CFrame.new
  27. VT = Vector3.new
  28. RAD = math.rad
  29. C3 = Color3.new
  30. UD2 = UDim2.new
  31. BRICKC = BrickColor.new
  32. ANGLES = CFrame.Angles
  33. EULER = CFrame.fromEulerAnglesXYZ
  34. COS = math.cos
  35. ACOS = math.acos
  36. SIN = math.sin
  37. ASIN = math.asin
  38. ABS = math.abs
  39. MRANDOM = math.random
  40. FLOOR = math.floor
  41. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  42. local NEWMESH = IT(MESH)
  43. if MESH == "SpecialMesh" then
  44. NEWMESH.MeshType = MESHTYPE
  45. if MESHID ~= "nil" and MESHID ~= "" then
  46. NEWMESH.MeshId = "http://www.roblox.com/asset/?id=" .. MESHID
  47. end
  48. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  49. NEWMESH.TextureId = "http://www.roblox.com/asset/?id=" .. TEXTUREID
  50. end
  51. end
  52. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  53. NEWMESH.Scale = SCALE
  54. NEWMESH.Parent = PARENT
  55. return NEWMESH
  56. end
  57. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  58. local NEWPART = IT("Part")
  59. NEWPART.formFactor = FORMFACTOR
  60. NEWPART.Reflectance = REFLECTANCE
  61. NEWPART.Transparency = TRANSPARENCY
  62. NEWPART.CanCollide = false
  63. NEWPART.Locked = true
  64. NEWPART.Anchored = true
  65. if ANCHOR == false then
  66. NEWPART.Anchored = false
  67. end
  68. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  69. NEWPART.Name = NAME
  70. NEWPART.Size = SIZE
  71. NEWPART.Position = Torso.Position
  72. NEWPART.Material = MATERIAL
  73. NEWPART:BreakJoints()
  74. NEWPART.Parent = PARENT
  75. return NEWPART
  76. end
  77. Player_Size = 1
  78. Animation_Speed = 3
  79. Frame_Speed = 0.016666666666666666
  80. local Speed = 16
  81. local Effects2 = {}
  82. local weldBetween = function(a, b)
  83. local weldd = Instance.new("ManualWeld")
  84. weldd.Part0 = a
  85. weldd.Part1 = b
  86. weldd.C0 = CFrame.new()
  87. weldd.C1 = b.CFrame:inverse() * a.CFrame
  88. weldd.Parent = a
  89. return weldd
  90. end
  91. function createaccessory(attachmentpart, mesh, texture, scale, offset, color)
  92. local acs = Instance.new("Part")
  93. acs.CanCollide = false
  94. acs.Anchored = false
  95. acs.Size = Vector3.new(0, 0, 0)
  96. acs.CFrame = attachmentpart.CFrame
  97. acs.Parent = Character
  98. acs.BrickColor = color
  99. local meshs = Instance.new("SpecialMesh")
  100. meshs.MeshId = mesh
  101. meshs.TextureId = texture
  102. meshs.Parent = acs
  103. meshs.Scale = scale
  104. meshs.Offset = offset
  105. weldBetween(attachmentpart, acs)
  106. end
  107. function createbodypart(TYPE, COLOR, PART, OFFSET, SIZE)
  108. if TYPE == "Gem" then
  109. local acs = CreatePart(3, Character, "Plastic", 0, 0, COLOR, "Part", VT(0, 0, 0))
  110. acs.Anchored = false
  111. acs.CanCollide = false
  112. acs.CFrame = PART.CFrame
  113. local acs2 = CreateMesh("SpecialMesh", acs, "FileMesh", "9756362", "", SIZE, OFFSET)
  114. weldBetween(PART, acs)
  115. elseif TYPE == "Skull" then
  116. local acs = CreatePart(3, Character, "Plastic", 0, 0, COLOR, "Part", VT(0, 0, 0))
  117. acs.Anchored = false
  118. acs.CanCollide = false
  119. acs.CFrame = PART.CFrame
  120. local acs2 = CreateMesh("SpecialMesh", acs, "FileMesh", "4770583", "", SIZE, OFFSET)
  121. weldBetween(PART, acs)
  122. elseif TYPE == "Eye" then
  123. local acs = CreatePart(3, Character, "Neon", 0, 0, COLOR, "Part", VT(0, 0, 0))
  124. acs.Anchored = false
  125. acs.CanCollide = false
  126. acs.CFrame = PART.CFrame
  127. local acs2 = CreateMesh("SpecialMesh", acs, "Sphere", "", "", SIZE, OFFSET)
  128. weldBetween(PART, acs)
  129. end
  130. end
  131.  
  132.  
  133.  
  134.  
  135. function BanishingBullet()
  136. ATTACK = true
  137. Rooted = false
  138. for i = 0, 0.4, 0.1 / Animation_Speed do
  139. Swait()
  140. turnto(Mouse.Hit.p)
  141. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)
  142. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.5 / Animation_Speed)
  143. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)
  144. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
  145. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
  146. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
  147. end
  148. repeat
  149. for i = 0, 0.2, 0.1 / Animation_Speed do
  150. Swait()
  151. turnto(Mouse.Hit.p)
  152. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)
  153. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.5 / Animation_Speed)
  154. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)
  155. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
  156. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
  157. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
  158. end
  159. CreateSound("238353911", GunPoint, 10, MRANDOM(9, 11) / 10)
  160. MagicSphere(VT(0.1, 0.1, 0.1), 45, GunPoint.CFrame, "Really red", VT(0.1, 0.1, 0.1))
  161. MagicSphere(VT(0.1, 0.1, 0.1), 45, GunPoint.CFrame, "Really red", VT(0.05, 0.05, 0.05))
  162. local RayHit, Way = CastProperRay(GunPoint.Position, Mouse.Hit.p, 1500, Character)
  163. local distance = (GunPoint.Position - Way).magnitude
  164. for i = 1, 5 do
  165. local laser = Instance.new("Part", Effects)
  166. laser.Transparency = 0
  167. laser.CanCollide = false
  168. laser.Anchored = true
  169. laser.Color = C3(1, 0, 0)
  170. laser.Material = "Neon"
  171. laser.formFactor = Enum.FormFactor.Custom
  172. laser.Size = Vector3.new(0.15, 0.15, distance)
  173. laser.CFrame = CFrame.new(GunPoint.Position, Way) * CFrame.new(0, 0, -distance / 2)
  174. MagicSphere(VT(0.1, 0.1, 0.1), 45, CF(Way), "Really red", VT(0.05, 0.05, 0.05))
  175. for i = 1, 5 do
  176. MagicSphere(VT(0.2, 0.2, 1), 65, CF(CF(Way) * CF(MRANDOM(-1, 1), MRANDOM(-1, 1), MRANDOM(-1, 1)).p, Way), "Really red", VT(0.001, 0.001, 0), 0.5)
  177. end
  178. table.insert(Effects2, {
  179. laser,
  180. "Disappear",
  181. 0.1,
  182. 1,
  183. 1,
  184. 1,
  185. 2
  186. })
  187. if RayHit ~= nil then
  188. local v = RayHit.Parent
  189. if v ~= nil and v.ClassName == "Model" then
  190. CastWarpOutlines(v)
  191. v.Parent = nil
  192. if game.Players:FindFirstChild(v.Name) then
  193. local Value = IT("BoolValue", Delete)
  194. Value.Name = v.Name
  195. end
  196. end
  197. end
  198. end
  199. for i = 0, 0.3, 0.1 / Animation_Speed do
  200. Swait()
  201. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)
  202. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.25 / Animation_Speed)
  203. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(15), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)
  204. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
  205. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
  206. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
  207. end
  208. until KEYHOLD == false
  209. ATTACK = false
  210. Rooted = false
  211. end
  212.  
  213. function KeyDown(Key)
  214. KEYHOLD = true
  215. if Key == "z" and ATTACK == false then
  216. BanishingBullet()
  217. end
  218.  
  219. function CheckIntangible(Hit)
  220. local ProjectileNames = {
  221. "Water",
  222. "Arrow",
  223. "Projectile",
  224. "Effect",
  225. "Rail",
  226. "Lightning",
  227. "Bullet"
  228. }
  229. if Hit and Hit.Parent and (not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid") then
  230. return true
  231. end
  232. return false
  233. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement