Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script has been converted to FE by iPxter
- 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(0.1)
- ----------------------------------------
- -- Originally made by Coolboy5038 :D --
- ----------------------------------------
- -- there's no time to explain! --
- CV="Bright red"
- p = owner
- char = p.Character
- local txt = Instance.new("BillboardGui", char)
- txt.Adornee = char .Head
- txt.Name = "_status"
- txt.Size = UDim2.new(2, 0, 1.2, 0)
- txt.StudsOffset = Vector3.new(-9, 8, 0)
- local text = Instance.new("TextLabel", txt)
- text.Size = UDim2.new(10, 0, 7, 0)
- text.FontSize = "Size24"
- text.TextScaled = true
- text.TextTransparency = 0
- text.BackgroundTransparency = 1
- text.TextTransparency = 0
- text.TextStrokeTransparency = 0
- text.Font = "Code"
- text.TextStrokeColor3 = Color3.new(10,0,0)
- v=Instance.new("Part")
- v.Name = "ColorBrick"
- v.Parent=p.Character
- v.FormFactor="Symmetric"
- v.Anchored=true
- v.CanCollide=false
- v.BottomSurface="Smooth"
- v.TopSurface="Smooth"
- v.Size=Vector3.new(10,5,3)
- v.Transparency=1
- v.CFrame=char.Torso.CFrame
- v.BrickColor=BrickColor.new(CV)
- v.Transparency=1
- text.TextColor3 = Color3.new(10,0,0)
- v.Shape="Block"
- text.Text = "Death Gun"
- 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 char=player.Character
- local cam=workspace.Camera
- local mouse=player:GetMouse()
- 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
- snd='rbxassetid://'
- beamm=Instance.new('Model',workspace)
- beamm.Name='beam'
- laser=false
- rs=Instance.new('Part',char)
- rs.Transparency=1
- rs.CanCollide=false
- rs.TopSurface,rs.BottomSurface=0,0
- rs.FormFactor=1
- rs.Size=Vector3.new(.5,.5,.5)
- ls=rs:Clone()
- ls.Parent=char
- rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
- lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
- raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
- law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
- s1=Instance.new('Sound',char)
- s1.Volume=1
- s1.Pitch=1
- s1.Looped=true
- s1.SoundId=snd
- particles={}
- local wep=new('Part',char)
- wep.FormFactor=1
- wep.CanCollide=false
- wep.Size=v3(1,3,1)
- wep.TopSurface,wep.BottomSurface=0,0
- local wepw=weld(wep,char['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
- local beam=wep:Clone()
- beam:ClearAllChildren()
- beam.Material='Neon'
- beam.BrickColor=BrickColor.new('Really red')
- beam.Size=Vector3.new(100,100,1)
- beam.Transparency=.5
- beam.Anchored=true
- local ms=Instance.new('BlockMesh',beam)
- local inner=beam:Clone()
- inner.Transparency=0
- inner.Material='SmoothPlastic'
- inner.BrickColor=BrickColor.new('Really red')
- local ms2=inner.Mesh
- local expl=inner:Clone()
- expl.Mesh:Destroy()
- expl.Material='Neon'
- expl.BrickColor=BrickColor.new('Really red')
- expl.Size=Vector3.new(100,100,100)
- 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
- local exa=expl:Clone()
- exa.Size=Vector3.new(100,100,100)
- pl2=exa.light
- local part=exa:Clone()
- part.Size=Vector3.new(100,100,100)
- pl3=part.light
- pms=Instance.new('BlockMesh',part)
- char.Humanoid.Died:connect(function()
- laser=false
- beam.Parent=nil
- inner.Parent=nil
- expl.Parent=nil
- exa.Parent=nil
- s1:stop()
- end)
- mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
- laser=true
- s1.Volume=1
- s1:play()
- end end)
- mouse.Button1Up:connect(function()
- laser=false
- beam.Parent=nil
- inner.Parent=nil
- expl.Parent=nil
- exa.Parent=nil
- s1:stop()
- 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*999)
- mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,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 char.Humanoid.Sit and not char.Humanoid.PlatformStand then
- char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
- end
- if laser then
- beamm.Parent=workspace
- beam.Parent=beamm
- inner.Parent=beamm
- expl.Parent=beamm
- exa.Parent=beamm
- s1.Volume=s1.Volume-.0
- 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)
- hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
- if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
- Instance.new('Explosion',workspace).Position=pos
- 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.BlastRadius=1400
- 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))
- char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement