SHARE
TWEET

Untitled

a guest Oct 12th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ----------------------------------------
  2.  -- BYopi's Thing --
  3. ----------------------------------------
  4.  
  5.  -- Fire my blaser! --
  6.  
  7. local new=Instance.new
  8. local rad=math.rad
  9. local cf=CFrame.new
  10. local v3=Vector3.new
  11. local ang=function(x,y,z)
  12. return CFrame.Angles(rad(x),rad(y),rad(z))
  13. end
  14. local player=game:service'Players'.LocalPlayer
  15. local char=player.Character
  16. local cam=workspace.Camera
  17. local mouse=player:GetMouse()
  18. local weld=function(a,b,c0,c1)
  19. m=Instance.new('Motor',a)
  20. m.Part0=a
  21. m.Part1=b
  22. m.C0=c0
  23. m.C1=c1
  24. return m
  25. end
  26.  
  27. snd='rbxassetid://229425359'
  28. beamm=Instance.new('Model',workspace)
  29. beamm.Name='beam'
  30.  
  31. laser=false
  32.  
  33. rs=Instance.new('Part',char)
  34. rs.Transparency=1
  35. rs.CanCollide=false
  36. rs.TopSurface,rs.BottomSurface=0,0
  37. rs.FormFactor=3
  38. rs.Size=Vector3.new(.5,.5,.5)
  39.  
  40. ls=rs:Clone()
  41. ls.Parent=char
  42.  
  43. rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
  44. lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
  45. raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
  46. law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
  47.  
  48. s1=Instance.new('Sound',char)
  49. s1.Volume=1
  50. s1.Pitch=1.2
  51. s1.Looped=true
  52. s1.SoundId=snd
  53.  
  54. particles={}
  55.  
  56. local wep=new('Part',char)
  57. wep.FormFactor=3
  58. wep.CanCollide=false
  59. wep.Size=v3(1,3,1)
  60. wep.TopSurface,wep.BottomSurface=0,0
  61. local wepw=weld(wep,char['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
  62.  
  63. local beam=wep:Clone()
  64. beam:ClearAllChildren()
  65. beam.Material='Neon'
  66. beam.BrickColor=BrickColor.new('Really black')
  67. beam.Size=Vector3.new(3,3,1)
  68. beam.Transparency=.5
  69. beam.Anchored=true
  70. local ms=Instance.new('BlockMesh',beam)
  71. local inner=beam:Clone()
  72. inner.Transparency=0
  73. inner.Material='SmoothPlastic'
  74. inner.BrickColor=BrickColor.new('Black')
  75. local ms2=inner.Mesh
  76.  
  77. local expl=inner:Clone()
  78. expl.Mesh:Destroy()
  79. expl.Material='Neon'
  80. expl.BrickColor=BrickColor.new('Really black')
  81. expl.Size=Vector3.new(11,11,11)
  82. expl.Transparency=.55
  83. pl=Instance.new('PointLight',expl)
  84. pl.Color=expl.BrickColor.Color
  85. pl.Range=pl.Range*2
  86. pl.Name='light'
  87. local br=pl.Range
  88.  
  89. local exa=expl:Clone()
  90. exa.Size=Vector3.new(4,4,4)
  91. pl2=exa.light
  92.  
  93. local part=exa:Clone()
  94. part.Size=Vector3.new(1.5,1.5,1.5)
  95. pl3=part.light
  96. pms=Instance.new('BlockMesh',part)
  97.  
  98. char.Humanoid.Died:connect(function()
  99. laser=false
  100. beam.Parent=nil
  101. inner.Parent=nil
  102. expl.Parent=nil
  103. exa.Parent=nil
  104. s1:stop()
  105. end)
  106.  
  107. mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
  108. laser=true
  109. s1.Volume=1
  110. s1:play()
  111. end end)
  112. mouse.Button1Up:connect(function()
  113. laser=false
  114. beam.Parent=nil
  115. inner.Parent=nil
  116. expl.Parent=nil
  117. exa.Parent=nil
  118. s1:stop()
  119. end)
  120.  
  121. parti=0
  122. game:service'RunService'.Stepped:connect(function()
  123. parti=parti+1
  124. for i,v in pairs(particles) do
  125. v.CFrame=v.CFrame*CFrame.new(0,0,-.3)
  126. v.Transparency=v.Transparency+.08
  127. if v.Transparency >= 1 then
  128. v:Destroy()
  129. table.remove(particles,i)
  130. else
  131. v.Parent=beamm
  132. end
  133. end
  134. a=cam.CoordinateFrame.p
  135. b=mouse.Hit.p
  136. mhitr=Ray.new(a,(b-a).unit*999)
  137. mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
  138. raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8)
  139. law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43)
  140. if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then
  141. char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
  142. end
  143. if laser then
  144. beamm.Parent=workspace
  145. beam.Parent=beamm
  146. inner.Parent=beamm
  147. expl.Parent=beamm
  148. exa.Parent=beamm
  149. s1.Volume=s1.Volume-.002
  150.  
  151. ray=Ray.new((wep.CFrame*cf(0,-1.5,0)).p,((wep.CFrame*cf(0,-10,0)).p-(wep.CFrame*cf(0,-1.5,0)).p).unit*999)
  152. hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
  153.  
  154. if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
  155. Instance.new('Explosion',workspace).Position=pos
  156. end
  157. if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
  158. e=Instance.new('Explosion',workspace)
  159. e.Position=pos
  160. e.BlastRadius=14
  161. e.BlastPressure=1e4
  162. end
  163. if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
  164. hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass())
  165. end
  166.  
  167. if parti==math.floor(parti) then
  168. par=part:Clone()
  169. table.insert(particles,par)
  170. par.Parent=beamm
  171. par.Transparency=1-s1.Volume
  172. par.light.Range=br*s1.Volume
  173. par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
  174. end
  175.  
  176. mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude
  177. ms.Scale=v3(s1.Volume,s1.Volume,mag)
  178. ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
  179. beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180))
  180. inner.CFrame=beam.CFrame
  181. pl.Range=br*s1.Volume
  182. pl2.Range=br*s1.Volume
  183. expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume
  184. expl.Transparency=math.random(40,60)/100
  185. expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
  186. exa.Size=v3(4,4,4)*s1.Volume
  187. exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
  188. char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
  189. end
  190. end)
  191. plr = game.Players.LocalPlayer
  192. mouse = plr:GetMouse()
  193. part = nil
  194. bp = nil
  195. particles = nil
  196. function clerp(a,b,c,d)
  197.     for i = 0,d,.01 do
  198.         a.CFrame = CFrame.new(b:lerp(c,i))
  199.         wait()
  200.     end
  201. end
  202. function slerp(a2,b2,c2,d2)
  203.     for i2 = 0,d2,.01 do
  204.         a2.CFrame = CFrame.new(b2:lerp(c2,i2))
  205.         wait()
  206.     end
  207. end
  208. mouse.KeyDown:connect(function(key)
  209.     if key == "e" and plr.Character.Parent == workspace then
  210.         plr.Character.Parent = workspace.Camera
  211.         plr.Character.Archivable = true
  212.         Instance.new("ForceField",plr.Character).Visible = false
  213.         for y,t in pairs(plr.Character:GetChildren()) do
  214.             if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  215.                 t.Transparency = 1
  216.                 if t.Name == "Head" and t:FindFirstChild("face") then
  217.                     t.face.Transparency = 1
  218.                 end
  219.             elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  220.                 t.Handle.Transparency = 1
  221.             end
  222.         end
  223.     elseif key == "z" and plr.Character.Parent == workspace.Camera and part == nil then
  224.         plr.Character.Torso.CFrame = CFrame.new(Vector3.new(mouse.hit.p.X,mouse.hit.p.Y+1.5,mouse.hit.p.Z),plr.Character.Torso.CFrame.p)
  225.     elseif key == "x" and plr.Character.Parent == workspace.Camera and part == nil then
  226.         if plr.Character.Torso.Anchored == true then
  227.             for y,t in pairs(plr.Character:GetChildren()) do
  228.                 if t:IsA("Part") then
  229.                     t.Anchored = false
  230.                 end
  231.             end
  232.         else
  233.             for y,t in pairs(plr.Character:GetChildren()) do
  234.                 if t:IsA("Part") then
  235.                     t.Anchored = true
  236.                 end
  237.             end
  238.         end
  239.     elseif key == "c" and plr.Character.Parent == workspace.Camera and part ~= nil then
  240.         local clone = part:Clone()
  241.         clone.Parent = workspace
  242.         clone.Anchored = false
  243.         clone:ClearAllChildren()
  244.         clone.CanCollide = true
  245.         bp.Parent = clone
  246.         particles.Parent = clone
  247.         if part.Parent:FindFirstChildOfClass("Humanoid") then
  248.             part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false
  249.         end
  250.         part:Destroy()
  251.         part = clone
  252.     elseif key == "t" and plr.Character.Parent == workspace.Camera and part == nil then
  253.         plr.Character.Parent = workspace
  254.         plr.Character.Archivable = false
  255.         plr.Character:FindFirstChildOfClass("ForceField"):Remove()
  256.         for y,t in pairs(plr.Character:GetChildren()) do
  257.             if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  258.                 t.Transparency = 0
  259.                 if t.Name == "Head" and t:FindFirstChild("face") then
  260.                     t.face.Transparency = 0
  261.                 end
  262.             elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  263.                 t.Handle.Transparency = 0
  264.             end
  265.         end
  266.     end
  267. end)
  268. mouse.Button1Down:connect(function()
  269.     if plr.Character.Parent == workspace.Camera then
  270.         if mouse ~= nil then
  271.             if mouse.Target ~= nil then
  272.                 part = mouse.Target
  273.                 bp = Instance.new("BodyPosition",part)
  274.                 bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  275.                 bp.Position = part.Position
  276.                 particles = Instance.new("ParticleEmitter",part)
  277.                 particles.Color = ColorSequence.new(Color3.new(0,0,0))
  278.                 particles.Size = NumberSequence.new(1)
  279.                 particles.Texture = "rbxassetid://292289455"
  280.                 particles.VelocitySpread = 360
  281.                 particles.Speed = NumberRange.new(0)
  282.                 particles.RotSpeed = NumberRange.new(0)
  283.                 particles.Rotation = NumberRange.new(0)
  284.                 particles.Rate = 250
  285.                 particles.Lifetime = NumberRange.new(.2,.4)
  286.                 particles.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(.12,.688,0),NumberSequenceKeypoint.new(.891,.887,0),NumberSequenceKeypoint.new(1,1,0)})
  287.                 dwn = true
  288.             end
  289.         end
  290.         while dwn == true do
  291.             wait() 
  292.             bp.Position = mouse.hit.p
  293.             if part then
  294.                 if part.Parent:FindFirstChildOfClass("Humanoid") then
  295.                     part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = true
  296.                 end
  297.             end
  298.         end
  299.     end
  300. end)
  301. mouse.Button1Up:connect(function()
  302.     dwn = false
  303.     if part then if part.Parent:FindFirstChildOfClass("Humanoid") then part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false end part = nil end
  304.     if bp then bp:Destroy() end
  305.     if particles then particles:Destroy() end
  306. end)
  307. base = Instance.new("ScreenGui",plr.PlayerGui)
  308. bbg = Instance.new("BillboardGui",plr.Character.Head)
  309. bbg.Size = UDim2.new(0,200,0,50)
  310. bbg.StudsOffset = Vector3.new(0,3,0)
  311. bbgTl = Instance.new("TextLabel",bbg)
  312. bbgTl.BackgroundTransparency = 1
  313. bbgTl.Size = UDim2.new(10,0,1,0)
  314. bbgTl.Position = UDim2.new(-4.5,0,0,0)
  315. bbgTl.Font = "Code"
  316. bbgTl.Text = " "
  317. bbgTl.TextSize = 25
  318. bbgTl.TextStrokeColor3 = Color3.new(1,1,1)
  319. bbgTl.TextColor3 = Color3.new(0,0,0)
  320. bbgTl.TextStrokeTransparency = 0
  321. bbgTl.TextWrapped = true
  322. plr.Chatted:connect(function(msg)
  323.     bbgTl.Text = msg
  324.     wait(5)
  325.     if bbgTl.Text == msg then
  326.         bbgTl.Text = " "
  327.     end
  328. end)
  329. touchCounter = 0
  330. while wait() do
  331.     if plr.Character.Parent == workspace.Camera then
  332.         local c = plr.Character:Clone()
  333.         c:MakeJoints()
  334.         for y,t in pairs(c:GetChildren()) do
  335.             if t:IsA("Part") then
  336.                 t.CanCollide = false
  337.                 t.Anchored = true
  338.                 t.Transparency = .5
  339.                 t.TopSurface = "Smooth"
  340.                 t.BottomSurface = "Smooth"
  341.                 t.RightSurface = "Smooth"
  342.                 t.LeftSurface = "Smooth"
  343.                 t.FrontSurface = "Smooth"
  344.                 t.BackSurface = "Smooth"
  345.                 t.BrickColor = BrickColor.new("Really black")
  346.                 if t.Name == "Head" and t:FindFirstChild("face") then
  347.                     t.face:Remove()
  348.                 elseif t.Name == "Torso" and t:FindFirstChild("roblox") then
  349.                     t.roblox:Remove()
  350.                 elseif t.Name == "HumanoidRootPart" then
  351.                     t:Remove()
  352.                 end
  353.             else
  354.                 t:Remove()
  355.             end
  356.         end
  357.         c.Parent = workspace
  358.         game.Debris:AddItem(c,.05)
  359.     end
  360. end
RAW Paste Data
Top