Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------
- -- Originally made by Alfederate --
- ----------------------------------------
- -- really just an improved version with camera shaking and shit so yeah, this was made by xiaxiaokid when he was bored --
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- wait(1/60)
- local new=Instance.new
- local rad=math.rad
- local cf=CFrame.new
- local v3=Vector3.new
- local ang=function(x,y,z)
- return CFrame.Angles(rad(x),rad(y),rad(z))
- end
- local Player = owner
- local Character = Player.Character
- local Humanoid = Character:FindFirstChildOfClass("Humanoid")
- local Torso = Character.Torso
- local cam=workspace.Camera
- local weld=function(a,b,c0,c1)
- m=Instance.new('Motor',a)
- m.Part0=a
- m.Part1=b
- m.C0=c0
- m.C1=c1
- return m
- end
- beamm=Instance.new('Model',workspace)
- beamm.Name='beam'
- laser=false
- EffectModel = Instance.new("Model", Character)
- EffectModel.Name = "Effects"
- rs=Instance.new('Part',Character)
- rs.Transparency=1
- rs.CanCollide=false
- rs.TopSurface,rs.BottomSurface=0,0
- rs.FormFactor=3
- rs.Size=Vector3.new(.5,.5,.5)
- ls=rs:Clone()
- ls.Parent=Character
- rsw=weld(rs,Character.Torso,cf(-1,-.5,0),cf())
- lsw=weld(ls,Character.Torso,cf(1,-.5,0),cf())
- raw=weld(Character['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
- law=weld(Character['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
- particles={}
- local wep=new('Part',Character)
- wep.FormFactor=3
- wep.CanCollide=false
- wep.Size=v3(1,3,1)
- wep.Transparency = 1
- wep.TopSurface,wep.BottomSurface=0,0
- local wepw=weld(wep,Character['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
- local meshpartthing = new('Part',Character)
- meshpartthing.FormFactor=3
- meshpartthing.CanCollide=false
- meshpartthing.BrickColor = BrickColor.new("Really black")
- meshpartthing.Size=v3(1,1,1)
- meshpartthing.TopSurface,wep.BottomSurface=0,0
- local meshpartthingweld=weld(meshpartthing,Character['Right Arm'],cf(.26,-.4,.7),ang(-90,0,8))
- SpecialMesh1 = Instance.new("SpecialMesh")
- SpecialMesh1.Parent = meshpartthing
- SpecialMesh1.MeshId = "rbxassetid://1079186565"
- SpecialMesh1.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh1.MeshType = Enum.MeshType.FileMesh
- local beam=wep:Clone()
- beam:ClearAllChildren()
- beam.Material='Neon'
- beam.BrickColor=BrickColor.new('Toothpaste')
- beam.Size=Vector3.new(3,3,1)
- beam.Transparency=.5
- beam.Anchored=true
- s1=Instance.new('Sound',beam)
- s1.Volume=2
- s1.Pitch=1
- s1.Looped=true
- s1.SoundId='rbxassetid://183339994'
- s2=Instance.new('Sound',wep)
- s2.Volume=2
- s2.Pitch=1
- s2.Looped=true
- s2.SoundId='rbxassetid://183339994'
- pew = Instance.new('Sound',wep)
- pew.Volume = 1
- pew.Pitch = 1.5
- pew.Looped = false
- pew.SoundId = 'rbxassetid://1796772196'
- asd = Instance.new('Sound',wep)
- asd.Volume = 1
- asd.Pitch = 1
- asd.Looped = false
- asd.SoundId = 'rbxassetid://342472444'
- local ms=Instance.new('BlockMesh',beam)
- local inner=beam:Clone()
- inner.Transparency=0
- inner.Material='Neon'
- inner.BrickColor=BrickColor.new('Institutional white')
- local ms2=inner.Mesh
- local expl=inner:Clone()
- expl.Mesh:Destroy()
- expl.Material='Neon'
- expl.BrickColor=BrickColor.new('Toothpaste')
- expl.Size=Vector3.new(11,11,11)
- expl.Transparency=.55
- pl=Instance.new('PointLight',expl)
- pl.Color=expl.BrickColor.Color
- pl.Range=pl.Range*2
- pl.Name='light'
- local br=pl.Range
- CF = CFrame.new
- Mrandom = math.random
- cam = game.Workspace.CurrentCamera
- Rad = math.rad
- Euler = CFrame.fromEulerAnglesXYZ
- function CameraEnshaking(Length, Intensity)
- coroutine.resume(coroutine.create(function()
- local intensity = 1 * Intensity
- local rotM = 0.01 * Intensity
- for i = 0, Length, 0.1 do
- wait(1/120)
- intensity = intensity - 0.05 * Intensity / Length
- rotM = rotM - 5.0E-4 * Intensity / Length
- Humanoid.CameraOffset = Vector3.new(Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)))
- cam.CFrame = cam.CFrame * CF(Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity)), Rad(Mrandom(-intensity, intensity))) * Euler(Rad(Mrandom(-intensity, intensity)) * rotM, Rad(Mrandom(-intensity, intensity)) * rotM, Rad(Mrandom(-intensity, intensity)) * rotM)
- end
- Humanoid.CameraOffset = Vector3.new(0, 0, 0)
- end))
- end
- local exa=expl:Clone()
- exa.Size=Vector3.new(4,4,4)
- pl2=exa.light
- local part=exa:Clone()
- part.Size=Vector3.new(1.5,1.5,1.5)
- pl3=part.light
- pms=Instance.new('BlockMesh',part)
- Character.Humanoid.Died:connect(function()
- laser=false
- beam.Parent=nil
- inner.Parent=nil
- expl.Parent=nil
- exa.Parent=nil
- s1:Stop()
- s2:Stop()
- end)
- mouse.Button1Down:connect(function()
- if Character.Humanoid.Health~=0 then
- laser=true
- s1.Volume=1.2
- s1:Play()
- s2.Volume=1.2
- s2:Play()
- pew:Play()
- end
- end)
- mouse.Button1Up:connect(function()
- laser=false
- beam.Parent=nil
- inner.Parent=nil
- expl.Parent=nil
- exa.Parent=nil
- s1:Stop()
- s2:Stop()
- asd:Play()
- end)
- parti=0
- game:service'RunService'.Stepped:connect(function()
- parti=parti+1
- for i,v in pairs(particles) do
- v.CFrame=v.CFrame*CFrame.new(0,0,-.3)
- v.Transparency=v.Transparency+.08
- if v.Transparency >= 1 then
- v:Destroy()
- table.remove(particles,i)
- else
- v.Parent=beamm
- end
- end
- a=cam.CoordinateFrame.p
- b=mouse.Hit.p
- mhitr=Ray.new(a,(b-a).unit*9999)
- mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{Character,beamm})
- raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8)
- law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43)
- if not Character.Humanoid.Sit and not Character.Humanoid.PlatformStand then
- Character.Torso.CFrame=CFrame.new(Character.Torso.CFrame.p,Vector3.new(ps.x,Character.Torso.CFrame.p.y,ps.z))
- end
- if laser == true then
- beamm.Parent=workspace
- beam.Parent=beamm
- inner.Parent=beamm
- expl.Parent=beamm
- exa.Parent=beamm
- s1.Volume=s1.Volume-.002
- s2.Volume=s2.Volume-.002
- CameraEnshaking(0.5, 8*s1.Volume)
- 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*9999)
- hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{Character,beamm})
- if hit and hit.Parent:findFirstChildOfClass('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
- e=Instance.new('Explosion',workspace)
- e.Position=pos
- local boom = Instance.new('Sound',hit)
- boom.SoundId = "rbxassetid://262562442"
- boom.Volume = 8
- boom:play()
- if hit:FindFirstChild('Head') ~= nil then
- hit:BreakJoints()
- end
- end
- if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
- e=Instance.new('Explosion',workspace)
- e.Position=pos
- e.Visible = false
- boom:play()
- e.BlastRadius=14
- e.BlastPressure=1e4
- end
- if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
- hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass())
- end
- if parti==math.floor(parti) then
- par=part:Clone()
- table.insert(particles,par)
- par.Parent=beamm
- par.Transparency=1-s1.Volume
- par.light.Range=br*s1.Volume
- par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
- end
- mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude
- ms.Scale=v3(s1.Volume,s1.Volume,mag)
- ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
- beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180))
- inner.CFrame=beam.CFrame
- pl.Range=br*s1.Volume
- pl2.Range=br*s1.Volume
- expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume
- expl.Transparency=math.random(40,60)/100
- expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
- exa.Size=v3(4,4,4)*s1.Volume
- exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
- --Character.Torso.Velocity=Character.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement