Advertisement
BabyGoatz

Untitled

Oct 6th, 2015
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.72 KB | None | 0 0
  1. local plr = game.Workspace.BabyGoatz
  2. local tool = Instance.new("Tool")
  3. tool.Parent = plr
  4. tool.Name = 'Wand'
  5. local part = Instance.new("Part")
  6. part.Parent = tool
  7. part.Name = 'Handle'
  8. part.Size = Vector3.new(1,1,1)
  9. part.Material = 'Neon'
  10. part.BrickColor = BrickColor.new("Really red")
  11. local fire = Instance.new("Fire")
  12. fire.Parent = part
  13. fire.Color = Color3.new(0,0,0)
  14. fire.SecondaryColor = Color3.new("1,1,1")
  15. fire.Size = 5
  16. local mesh = Instance.new("SpecialMesh")
  17. mesh.Parent = part
  18. mesh.MeshId = "http://www.roblox.com/asset/?id=123968188"
  19. local plr = game.Players.LocalPlayer
  20. local char = plr.Character
  21. local mouse = plr:GetMouse()
  22. local torso = char.Torso
  23. local head = char.Head
  24. local ra = char["Right Arm"]
  25. local la = char["Left Arm"]
  26. local rl = char["Right Leg"]
  27. local ll = char["Left Leg"]
  28. local human = char["Humanoid"]
  29. local camera = workspace.CurrentCamera
  30. local rs = torso:findFirstChild("Right Shoulder")
  31. local ls = torso:findFirstChild("Left Shoulder")
  32. local neck = torso:findFirstChild("Neck")
  33. local NO_moar_shooting = false
  34. local RunService = game:service'RunService'
  35. local ammo = 1
  36. local spred = 2
  37.  
  38.  
  39.  
  40. function trail(obj) -- wroten by kert109
  41. local lastPos = obj.CFrame.p
  42. coroutine.wrap(function()
  43. while obj ~= nil do
  44. RunService.Stepped:wait()
  45. local objC = obj:Clone()
  46. pcall(function()
  47. objC.Mesh:Destroy()
  48. end)
  49. objC.BrickColor = BrickColor.White()
  50. Instance.new("BlockMesh", objC).Scale = Vector3.new(0.2, 0.2, 1)
  51. objC.Parent = obj.Parent -- EPIC FAILURE> xD LOL
  52. objC.Anchored = true
  53. local distance = (lastPos- obj.CFrame.p).magnitude
  54. objC.Size = Vector3.new(.4,.4,distance)
  55. objC.CFrame = CFrame.new(lastPos,obj.Position)*CFrame.new(0,0,-distance/2)
  56. coroutine.wrap(function()
  57. for i = 0,1,.2 do
  58. wait()
  59. objC.Transparency = i
  60. end
  61. objC:Destroy() -- Easiest way without tables. :D
  62. end)()
  63. lastPos = obj.CFrame.p
  64. end
  65. end)() -- This
  66. end
  67.  
  68.  
  69. local sound = Instance.new("Sound", head)
  70. sound.SoundId = "http://www.roblox.com/asset/?id=16211041"
  71. sound.Volume = 1
  72. local reloads = Instance.new("Sound", head)
  73. reloads.SoundId = "http://roblox.com/asset/?id=10209636"
  74. reloads.Volume = 1
  75. reloads.Pitch = 0.7
  76. local activate = Instance.new("Sound", head)
  77. activate.SoundId = "http://roblox.com/asset/?id=10209881"
  78. activate.Volume = 1
  79. activate.Pitch = 0.7
  80.  
  81.  
  82. local equipped = false
  83.  
  84. local debounce = false
  85.  
  86. local face = head.face
  87.  
  88.  
  89. release = Instance.new("Part", nil)
  90. release.FormFactor = "Custom"
  91. release.Size = Vector3.new(0.3, 1.7, 0.3)
  92. release.BrickColor = BrickColor.new("Brown")
  93. local weld = Instance.new("Weld", release)
  94. weld.Part0 = release
  95. weld.Part1 = head
  96. weld.C0 = CFrame.new(0, -0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  97. local mesh = Instance.new("CylinderMesh", release)
  98.  
  99. release2 = Instance.new("Part", nil)
  100. release2.FormFactor = "Custom"
  101. release2.Size = Vector3.new(0.2, 1.4, 0.2)
  102. release2.BrickColor = BrickColor.new("Brown")
  103. local weld2 = Instance.new("Weld", release2)
  104. weld2.Part0 = release2
  105. weld2.Part1 = head
  106. weld2.C0 = CFrame.new(0.5, 0, -0.2) * CFrame.Angles(math.pi/2, math.pi/2, 0)
  107. local mesh2 = Instance.new("CylinderMesh", release2)
  108.  
  109. headext = Instance.new("Part", nil)
  110. headext.Position = torso.Position
  111. headext.FormFactor = "Custom"
  112. headext.Transparency = 1
  113. headext:BreakJoints()
  114. headext.Size = Vector3.new(2, 1, 1)
  115. headextw = Instance.new("Weld", headext)
  116. headextw.C0 = CFrame.new(Vector3.new(0, 1.5, 0))
  117. headextw.Part0 = torso
  118. headextw.Part1 = headext
  119. headextw.C1 = CFrame.new()
  120. headweld = Instance.new("Weld", headext)
  121. game:service("RunService").Stepped:connect(function()
  122. headweld.C0 = CFrame.new(Vector3.new(0,0,0), torso.CFrame:pointToObjectSpace(mouse.Hit.p)) * CFrame.Angles(0, 0, 0)
  123. end)
  124. headweld.Part0 = headext
  125. headweld.C1 = CFrame.new()
  126. headweld.Part1 = head
  127.  
  128. local Screen = Instance.new("ScreenGui", plr:findFirstChild("PlayerGui"))
  129. local TextBox = Instance.new("TextLabel", Screen)
  130. TextBox.Position = UDim2.new(0.1, 0, 0.95, 0)
  131. TextBox.Size = UDim2.new(0, 200, 0.05, 0)
  132. TextBox.BackgroundTransparency = 1
  133. game:service'RunService'.Stepped:connect(function()
  134. TextBox.Text = ("Ammo: "..ammo)
  135. end)
  136. TextBox.Font = "SourceSansBold"
  137. TextBox.TextColor3 = Color3.new(1, 1, 1)
  138. TextBox.FontSize = "Size36"
  139. TextBox.TextStrokeTransparency = 0
  140.  
  141. local pl = Instance.new("PointLight", release)
  142. pl.Range = 16
  143. pl.Brightness = 5
  144. pl.Color = Color3.new(1, 199/255, 67/255)
  145. pl.Enabled = false
  146. function reload()
  147. wait(0.2)
  148. reloads:play()
  149. wait(0.5)
  150. ammo = 1
  151. wait(1.5)
  152. activate:play()
  153. wait(0.5)
  154. debounce = false
  155. end
  156.  
  157. mouse.KeyDown:connect(function(key)
  158. if key == "r" then
  159. if debounce then return end
  160. if not equipped then return end
  161. if ammo > 0 then return end
  162. debounce = true
  163. reload()
  164. end
  165.  
  166. if key == "q" then
  167. equipped = not equipped
  168. if equipped then
  169. headext.Parent = char
  170. release.Parent = char
  171. release2.Parent = char
  172. face.Parent = nil
  173. for scale = 0, 1, 0.2 do
  174. weld2.C0 = CFrame.new(scale, 0, -0.2) * CFrame.Angles(math.pi/2, math.pi/2, 0)
  175. weld.C0 = CFrame.new(0, -scale + 0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  176. mesh.Scale = Vector3.new(1, scale, 1)
  177. mesh2.Scale = Vector3.new(1, scale, 1)
  178. wait()
  179. end
  180. else
  181. face.Parent = head
  182. release.Parent = nil
  183. release2.Parent = nil
  184. headext.Parent = nil
  185. end
  186. end
  187. end)
  188.  
  189. mouse.Button1Down:connect(function()
  190. if not equipped then return end
  191. if ammo < 1 then return end
  192. if debounce then return end
  193. debounce = true
  194. sound:play()
  195. ammo = ammo - 1
  196. coroutine.wrap(function()
  197. for scale = 0.7, 1, 0.1 do
  198. mesh.Scale = Vector3.new(1, scale, 1)
  199. wait()
  200. end
  201. end)()
  202.  
  203. coroutine.wrap(function()
  204. if char.Humanoid.Health < 1 then return end
  205. local rayPart = Instance.new("Part", char)
  206. rayPart.Name = "RayPart"
  207. rayPart.BrickColor = BrickColor.Yellow()
  208. rayPart.Anchored = true
  209. rayPart.CanCollide = false
  210. rayPart.TopSurface = Enum.SurfaceType.Smooth
  211. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  212. rayPart.formFactor = Enum.FormFactor.Custom
  213. rayPart.Size = Vector3.new(0.2, 0.2, 4)
  214. local mesh = Instance.new("SpecialMesh", rayPart)
  215. mesh.MeshType = "FileMesh"
  216. mesh.MeshId = "http://www.roblox.com/asset/?id=15887356"
  217. mesh.TextureId = "http://www.roblox.com/asset/?id=15886781"
  218. mesh.Scale = Vector3.new(-1, 1, -1.5)
  219.  
  220.  
  221.  
  222.  
  223. local bulletposition = release.Position
  224. local bulletvelocity = (Vector3.new(math.random(-spred,spred), math.random(-spred,spred), math.random(-spred,spred)))+( mouse.Hit.p - bulletposition).unit*150
  225. local bulletlastposition = bulletposition
  226. rayPart.CFrame = CFrame.new( bulletposition, bulletposition+bulletvelocity )
  227. local connection = trail(rayPart)
  228.  
  229.  
  230.  
  231.  
  232.  
  233. coroutine.resume(coroutine.create(function()
  234. while true do
  235. local dt = wait()
  236. bulletlastposition = bulletposition
  237. bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*10, 0)*dt)
  238. bulletposition = bulletposition + (bulletvelocity*dt)
  239.  
  240. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  241. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
  242.  
  243. if (torso.Position - rayPart.Position).magnitude > 440 then
  244. rayPart:Destroy()
  245. break
  246. end
  247.  
  248.  
  249. if hit then
  250. local damage = math.random(40, 75)
  251. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  252. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
  253. coroutine.wrap(function()
  254. local prt = Instance.new("Part", char)
  255. prt.FormFactor = "Custom"
  256. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  257. prt.Transparency = 1
  258. prt.CanCollide = false
  259. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  260. prt.Anchored = true
  261. coroutine.resume(coroutine.create(function()
  262. for i = 2, 10, 0.1 do
  263. if prt == nil then return end
  264. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  265. game:service'RunService'.Stepped:wait()
  266. end
  267. end))
  268.  
  269. local bg = Instance.new("BillboardGui")
  270. bg.Parent = prt
  271. bg.Adornee = prt
  272. bg.Size = UDim2.new(4, 0, 3.5, 0)
  273. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  274. local lol = Instance.new("TextLabel")
  275. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  276. lol.TextScaled = true
  277. lol.TextWrapped = true
  278. lol.BackgroundTransparency = 1
  279. lol.Parent = bg
  280. lol.FontSize = "Size24"
  281. lol.TextColor3 = Color3.new(1, 0, 0)
  282. lol.TextStrokeTransparency = 0
  283. lol.Font = "ArialBold"
  284. lol.Text = "-"..damage
  285.  
  286. wait(3)
  287. prt:Destroy()
  288. end)()
  289. end
  290. if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
  291. hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
  292. coroutine.wrap(function()
  293. local prt = Instance.new("Part", char)
  294. prt.FormFactor = "Custom"
  295. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  296. prt.Transparency = 1
  297. prt.CanCollide = false
  298. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  299. prt.Anchored = true
  300. coroutine.resume(coroutine.create(function()
  301. for i = 2, 10, 0.05 do
  302. if prt == nil then return end
  303. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  304. game:service'RunService'.Stepped:wait()
  305. end
  306. end))
  307.  
  308. local bg = Instance.new("BillboardGui")
  309. bg.Parent = prt
  310. bg.Adornee = prt
  311. bg.Size = UDim2.new(4, 0, 3.5, 0)
  312. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  313. local lol = Instance.new("TextLabel")
  314. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  315. lol.TextScaled = true
  316. lol.TextWrapped = true
  317. lol.BackgroundTransparency = 1
  318. lol.Parent = bg
  319. lol.FontSize = "Size24"
  320. lol.TextColor3 = Color3.new(1, 0, 0)
  321. lol.TextStrokeTransparency = 0
  322. lol.Font = "ArialBold"
  323. lol.Text = "-"..damage
  324.  
  325. wait(3)
  326. prt:Destroy()
  327. end)()
  328. end
  329. bulletposition = hitposition
  330. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  331. wait(0.5)
  332. rayPart:Destroy()
  333. connection:disconnect()
  334. break
  335. end
  336. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  337. end
  338. end))
  339. end)()
  340. wait(0.8)
  341. debounce = false
  342.  
  343. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement