gun test - Pastebin.com (2024)

  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. function BanishingBullet()

  132. ATTACK = true

  133. Rooted = false

  134. for i = 0, 0.4, 0.1 / Animation_Speed do

  135. Swait()

  136. turnto(Mouse.Hit.p)

  137. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)

  138. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.5 / Animation_Speed)

  139. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)

  140. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)

  141. 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)

  142. 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)

  143. end

  144. repeat

  145. for i = 0, 0.2, 0.1 / Animation_Speed do

  146. Swait()

  147. turnto(Mouse.Hit.p)

  148. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)

  149. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.5 / Animation_Speed)

  150. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)

  151. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)

  152. 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)

  153. 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)

  154. end

  155. CreateSound("238353911", GunPoint, 10, MRANDOM(9, 11) / 10)

  156. MagicSphere(VT(0.1, 0.1, 0.1), 45, GunPoint.CFrame, "Really red", VT(0.1, 0.1, 0.1))

  157. MagicSphere(VT(0.1, 0.1, 0.1), 45, GunPoint.CFrame, "Really red", VT(0.05, 0.05, 0.05))

  158. local RayHit, Way = CastProperRay(GunPoint.Position, Mouse.Hit.p, 1500, Character)

  159. local distance = (GunPoint.Position - Way).magnitude

  160. for i = 1, 5 do

  161. local laser = Instance.new("Part", Effects)

  162. laser.Transparency = 0

  163. laser.CanCollide = false

  164. laser.Anchored = true

  165. laser.Color = C3(1, 0, 0)

  166. laser.Material = "Neon"

  167. laser.formFactor = Enum.FormFactor.Custom

  168. laser.Size = Vector3.new(0.15, 0.15, distance)

  169. laser.CFrame = CFrame.new(GunPoint.Position, Way) * CFrame.new(0, 0, -distance / 2)

  170. MagicSphere(VT(0.1, 0.1, 0.1), 45, CF(Way), "Really red", VT(0.05, 0.05, 0.05))

  171. for i = 1, 5 do

  172. 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)

  173. end

  174. table.insert(Effects2, {

  175. laser,

  176. "Disappear",

  177. 0.1,

  178. 1,

  179. 1,

  180. 1,

  181. 2

  182. })

  183. if RayHit ~= nil then

  184. local v = RayHit.Parent

  185. if v ~= nil and v.ClassName == "Model" then

  186. CastWarpOutlines(v)

  187. v.Parent = nil

  188. if game.Players:FindFirstChild(v.Name) then

  189. local Value = IT("BoolValue", Delete)

  190. Value.Name = v.Name

  191. end

  192. end

  193. end

  194. end

  195. for i = 0, 0.3, 0.1 / Animation_Speed do

  196. Swait()

  197. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)

  198. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.25 / Animation_Speed)

  199. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(15), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)

  200. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)

  201. 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)

  202. 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)

  203. end

  204. until KEYHOLD == false

  205. ATTACK = false

  206. Rooted = false

  207. end

  208. function KeyDown(Key)

  209. KEYHOLD = true

  210. if Key == "z" and ATTACK == false then

  211. BanishingBullet()

  212. end

  213. function CheckIntangible(Hit)

  214. local ProjectileNames = {

  215. "Water",

  216. "Arrow",

  217. "Projectile",

  218. "Effect",

  219. "Rail",

  220. "Lightning",

  221. "Bullet"

  222. }

  223. if Hit and Hit.Parent and (not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid") then

  224. return true

  225. end

  226. return false

  227. end

gun test - Pastebin.com (2024)

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Maia Crooks Jr

Last Updated:

Views: 5591

Rating: 4.2 / 5 (63 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.