SHARE
TWEET

[FE] Death Gun (Voidacity)

Upscalefanatic3 Jun 26th, 2019 167 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7.     print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8.     script.Parent = Player.Character
  9.  
  10.     --RemoteEvent for communicating
  11.     local Event = Instance.new("RemoteEvent")
  12.     Event.Name = "UserInput_Event"
  13.  
  14.     --Fake event to make stuff like Mouse.KeyDown work
  15.     local function fakeEvent()
  16.         local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17.         t.connect = t.Connect
  18.         return t
  19.     end
  20.  
  21.     --Creating fake input objects with fake variables
  22.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26.     end}
  27.     --Merged 2 functions into one by checking amount of arguments
  28.     CAS.UnbindAction = CAS.BindAction
  29.  
  30.     --This function will trigger the events that have been :Connect()'ed
  31.     local function te(self,ev,...)
  32.         local t = m[ev]
  33.         if t and t._fakeEvent and t.Function then
  34.             t.Function(...)
  35.         end
  36.     end
  37.     m.TrigEvent = te
  38.     UIS.TrigEvent = te
  39.  
  40.     Event.OnServerEvent:Connect(function(plr,io)
  41.         if plr~=Player then return end
  42.         if io.isMouse then
  43.             m.Target = io.Target
  44.             m.Hit = io.Hit
  45.         else
  46.             local b = io.UserInputState == Enum.UserInputState.Begin
  47.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49.             end
  50.             for _,t in pairs(CAS.Actions) do
  51.                 for _,k in pairs(t.Keys) do
  52.                     if k==io.KeyCode then
  53.                         t.Function(t.Name,io.UserInputState,io)
  54.                     end
  55.                 end
  56.             end
  57.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59.         end
  60.     end)
  61.     Event.Parent = NLS([==[
  62.     local Player = game:GetService("Players").LocalPlayer
  63.     local Event = script:WaitForChild("UserInput_Event")
  64.  
  65.     local UIS = game:GetService("UserInputService")
  66.     local input = function(io,a)
  67.         if a then return end
  68.         --Since InputObject is a client-side instance, we create and pass table instead
  69.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70.     end
  71.     UIS.InputBegan:Connect(input)
  72.     UIS.InputEnded:Connect(input)
  73.  
  74.     local Mouse = Player:GetMouse()
  75.     local h,t
  76.     --Give the server mouse data 30 times every second, but only if the values changed
  77.     --If player is not moving their mouse, client won't fire events
  78.     while wait(1/30) do
  79.         if h~=Mouse.Hit or t~=Mouse.Target then
  80.             h,t=Mouse.Hit,Mouse.Target
  81.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  82.         end
  83.     end]==],Player.Character)
  84.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. wait(0.1)
  88.  
  89.  
  90.  
  91.  
  92.  
  93. ----------------------------------------
  94.  -- Originally made by Coolboy5038  :D --
  95. ----------------------------------------
  96.  
  97.  -- there's no time to explain! --
  98.  CV="Bright red"
  99.     p = owner
  100.     char = p.Character
  101.     local txt = Instance.new("BillboardGui", char)
  102.     txt.Adornee = char .Head
  103.     txt.Name = "_status"
  104.     txt.Size = UDim2.new(2, 0, 1.2, 0)
  105.     txt.StudsOffset = Vector3.new(-9, 8, 0)
  106.     local text = Instance.new("TextLabel", txt)
  107.     text.Size = UDim2.new(10, 0, 7, 0)
  108.     text.FontSize = "Size24"
  109.     text.TextScaled = true
  110.     text.TextTransparency = 0
  111.     text.BackgroundTransparency = 1
  112.     text.TextTransparency = 0
  113.     text.TextStrokeTransparency = 0
  114.     text.Font = "Code"
  115.     text.TextStrokeColor3 = Color3.new(10,0,0)
  116.  
  117.     v=Instance.new("Part")
  118.     v.Name = "ColorBrick"
  119.     v.Parent=p.Character
  120.     v.FormFactor="Symmetric"
  121.     v.Anchored=true
  122.     v.CanCollide=false
  123.     v.BottomSurface="Smooth"
  124.     v.TopSurface="Smooth"
  125.     v.Size=Vector3.new(10,5,3)
  126.     v.Transparency=1
  127.     v.CFrame=char.Torso.CFrame
  128.     v.BrickColor=BrickColor.new(CV)
  129.     v.Transparency=1
  130.     text.TextColor3 = Color3.new(10,0,0)
  131.     v.Shape="Block"
  132.     text.Text = "Death Gun"
  133.    
  134. local new=Instance.new
  135. local rad=math.rad
  136. local cf=CFrame.new
  137. local v3=Vector3.new
  138. local ang=function(x,y,z)
  139. return CFrame.Angles(rad(x),rad(y),rad(z))
  140. end
  141. local player=owner
  142. local char=player.Character
  143. local cam=workspace.Camera
  144. local mouse=player:GetMouse()
  145. local weld=function(a,b,c0,c1)
  146. m=Instance.new('Motor',a)
  147. m.Part0=a
  148. m.Part1=b
  149. m.C0=c0
  150. m.C1=c1
  151. return m
  152. end
  153.  
  154. snd='rbxassetid://'
  155. beamm=Instance.new('Model',workspace)
  156. beamm.Name='beam'
  157.  
  158. laser=false
  159.  
  160. rs=Instance.new('Part',char)
  161. rs.Transparency=1
  162. rs.CanCollide=false
  163. rs.TopSurface,rs.BottomSurface=0,0
  164. rs.FormFactor=1
  165. rs.Size=Vector3.new(.5,.5,.5)
  166.  
  167. ls=rs:Clone()
  168. ls.Parent=char
  169.  
  170. rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
  171. lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
  172. raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
  173. law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
  174.  
  175. s1=Instance.new('Sound',char)
  176. s1.Volume=1
  177. s1.Pitch=1
  178. s1.Looped=true
  179. s1.SoundId=snd
  180.  
  181. particles={}
  182.  
  183. local wep=new('Part',char)
  184. wep.FormFactor=1
  185. wep.CanCollide=false
  186. wep.Size=v3(1,3,1)
  187. wep.TopSurface,wep.BottomSurface=0,0
  188. local wepw=weld(wep,char['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
  189.  
  190. local beam=wep:Clone()
  191. beam:ClearAllChildren()
  192. beam.Material='Neon'
  193. beam.BrickColor=BrickColor.new('Really red')
  194. beam.Size=Vector3.new(100,100,1)
  195. beam.Transparency=.5
  196. beam.Anchored=true
  197. local ms=Instance.new('BlockMesh',beam)
  198. local inner=beam:Clone()
  199. inner.Transparency=0
  200. inner.Material='SmoothPlastic'
  201. inner.BrickColor=BrickColor.new('Really red')
  202. local ms2=inner.Mesh
  203.  
  204. local expl=inner:Clone()
  205. expl.Mesh:Destroy()
  206. expl.Material='Neon'
  207. expl.BrickColor=BrickColor.new('Really red')
  208. expl.Size=Vector3.new(100,100,100)
  209. expl.Transparency=.55
  210. pl=Instance.new('PointLight',expl)
  211. pl.Color=expl.BrickColor.Color
  212. pl.Range=pl.Range*2
  213. pl.Name='light'
  214. local br=pl.Range
  215.  
  216. local exa=expl:Clone()
  217. exa.Size=Vector3.new(100,100,100)
  218. pl2=exa.light
  219.  
  220. local part=exa:Clone()
  221. part.Size=Vector3.new(100,100,100)
  222. pl3=part.light
  223. pms=Instance.new('BlockMesh',part)
  224.  
  225. char.Humanoid.Died:connect(function()
  226. laser=false
  227. beam.Parent=nil
  228. inner.Parent=nil
  229. expl.Parent=nil
  230. exa.Parent=nil
  231. s1:stop()
  232. end)
  233.  
  234. mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
  235. laser=true
  236. s1.Volume=1
  237. s1:play()
  238. end end)
  239. mouse.Button1Up:connect(function()
  240. laser=false
  241. beam.Parent=nil
  242. inner.Parent=nil
  243. expl.Parent=nil
  244. exa.Parent=nil
  245. s1:stop()
  246. end)
  247.  
  248. parti=0
  249. game:service'RunService'.Stepped:connect(function()
  250. parti=parti+1
  251. for i,v in pairs(particles) do
  252. v.CFrame=v.CFrame*CFrame.new(0,0,-.3)
  253. v.Transparency=v.Transparency+.08
  254. if v.Transparency >= 1 then
  255. v:Destroy()
  256. table.remove(particles,i)
  257. else
  258. v.Parent=beamm
  259. end
  260. end
  261. a=cam.CoordinateFrame.p
  262. b=mouse.Hit.p
  263. mhitr=Ray.new(a,(b-a).unit*999)
  264. mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
  265. raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8)
  266. law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43)
  267. if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then
  268. char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
  269. end
  270. if laser then
  271. beamm.Parent=workspace
  272. beam.Parent=beamm
  273. inner.Parent=beamm
  274. expl.Parent=beamm
  275. exa.Parent=beamm
  276. s1.Volume=s1.Volume-.0
  277.  
  278. 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)
  279. hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
  280.  
  281. if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
  282. Instance.new('Explosion',workspace).Position=pos
  283. end
  284. if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
  285. e=Instance.new('Explosion',workspace)
  286. e.Position=pos
  287. e.BlastRadius=1400
  288. e.BlastPressure=1e4
  289. end
  290. if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
  291. hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass())
  292. end
  293.  
  294. if parti==math.floor(parti) then
  295. par=part:Clone()
  296. table.insert(particles,par)
  297. par.Parent=beamm
  298. par.Transparency=1-s1.Volume
  299. par.light.Range=br*s1.Volume
  300. par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
  301. end
  302.  
  303. mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude
  304. ms.Scale=v3(s1.Volume,s1.Volume,mag)
  305. ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
  306. beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180))
  307. inner.CFrame=beam.CFrame
  308. pl.Range=br*s1.Volume
  309. pl2.Range=br*s1.Volume
  310. expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume
  311. expl.Transparency=math.random(40,60)/100
  312. expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
  313. exa.Size=v3(4,4,4)*s1.Volume
  314. exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
  315. char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
  316. end
  317. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top