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
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- LocalScript3 = Instance.new("LocalScript")
- Part4 = Instance.new("Part")
- SpecialMesh5 = Instance.new("SpecialMesh")
- Tool0.Name = "Shotgun"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=19339420"
- Tool0.GripPos = Vector3.new(0, 0, 0.5)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.BrickColor = BrickColor.new("Black")
- Part1.Rotation = Vector3.new(0, -90, 0)
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(1, 1, 5)
- Part1.CFrame = CFrame.new(-6.63999891, 0.500003994, -11.4400177, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part1.Position = Vector3.new(-6.63999891, 0.500003994, -11.4400177)
- Part1.Orientation = Vector3.new(0, -90, 0)
- Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=94219391"
- SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=94219470"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
- LocalScript3.Name = "Main"
- LocalScript3.Parent = Tool0
- table.insert(cors,sandbox(LocalScript3,function()
- --Made by Ahtoh13131423144235
- --GUN SETTINGS
- local char=nil--Do not change this
- local damage=50--Bullet Damage
- local maxAmmo=9--Max Ammo
- local clip=9
- local ammo=32--Stored Ammo
- local debounce=true--Do not change this
- --WELDS
- local rightArmWeld=nil
- local leftArmWeld=nil
- local flameWeld=Instance.new("Weld")
- flameWeld.Parent=script.Parent.Handle
- flameWeld.Name="FlameWeld"
- flameWeld.Part0=script.Parent.Handle
- flameWeld.Part1=script.Parent.Flame
- flameWeld.C0=CFrame.new(0,0.3,-3.5)*CFrame.fromEulerAnglesXYZ(0,80.1,0)
- --ANIMATIONS
- function equip()
- for i=1,16 do
- rightArmWeld.C0=rightArmWeld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
- leftArmWeld.C0=leftArmWeld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
- wait()
- end
- for i=1,7 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.fromEulerAnglesXYZ(0,0,0.1)
- wait()
- end
- for i=1,7 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(0.1,0,0)
- wait()
- end
- for i=1,15 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(0,-0.1,0)
- wait()
- end
- for i=1,7 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(-0.1,-0.1,0)
- wait()
- end
- end
- function shoot()
- for i=1,2 do
- rightArmWeld.C0=rightArmWeld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
- leftArmWeld.C0=leftArmWeld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0)
- script.Parent.Flame.Transparency=script.Parent.Flame.Transparency-0.4
- wait()
- end
- for i=1,2 do
- rightArmWeld.C0=rightArmWeld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
- leftArmWeld.C0=leftArmWeld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,0)
- script.Parent.Flame.Transparency=script.Parent.Flame.Transparency+0.4
- wait()
- end
- for i=1,5 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(-0.1,-0.1,0)
- wait()
- end
- for i=1,5 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(0.1,0.1,0)
- wait()
- end
- end
- function reload()
- for i=1,7 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(0.1,0.1,0)
- wait()
- end
- for i=1,14 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.fromEulerAnglesXYZ(-0.1,0,-0.1)
- wait()
- end
- wait()
- for i=1,14 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.fromEulerAnglesXYZ(0.1,0,0.1)
- wait()
- end
- for i=1,7 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(-0.1,-0.1,0)
- wait()
- end
- for i=1,5 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(-0.1,-0.1,0)
- wait()
- end
- for i=1,5 do
- leftArmWeld.C0=leftArmWeld.C0*CFrame.new(0.1,0.1,0)
- wait()
- end
- end
- --SCRIPT
- script.Parent.Activated:connect(function()
- if debounce==false and clip>0 then
- debounce=true
- local mouse=game.Players.LocalPlayer:GetMouse()
- if mouse.Target~=nil then
- if mouse.Target.Parent:FindFirstChild("Humanoid")~=nil then
- mouse.Target.Parent.Humanoid.Health=mouse.Target.Parent.Humanoid.Health-damage
- end
- end
- shoot()
- local shell=Instance.new("Part")
- shell.Parent=game.Workspace
- shell.Name="Shell"
- shell.Size=Vector3.new(0.1,0.2,0.1)
- shell.Position=script.Parent.Handle.Position+Vector3.new(0.4,0,0)
- shell.CanCollide=true
- shell.BrickColor=BrickColor.new("Bright red")
- local mesh=Instance.new("SpecialMesh")
- mesh.Parent=shell
- mesh.MeshType="Head"
- game.Debris:AddItem(shell,4)
- clip=clip-1
- debounce=false
- elseif debounce==false and clip<=0 and ammo>0 then
- debounce=true
- reload()
- clip=maxAmmo
- ammo=ammo-maxAmmo
- debounce=false
- end
- end)
- script.Parent.Equipped:connect(function()
- char=script.Parent.Parent
- rightArmWeld=Instance.new("Weld")
- rightArmWeld.Parent=char.Torso
- rightArmWeld.Part0=char.Torso
- rightArmWeld.Part1=char["Right Arm"]
- rightArmWeld.Name="RightWeld"
- rightArmWeld.C0=CFrame.new(1.5,0.5,0)
- rightArmWeld.C1=CFrame.new(0,0.5,0)
- leftArmWeld=Instance.new("Weld")
- leftArmWeld.Parent=char.Torso
- leftArmWeld.Name="LeftWeld"
- leftArmWeld.Part0=char.Torso
- leftArmWeld.Part1=char["Left Arm"]
- leftArmWeld.C0=CFrame.new(-1.5,0.5,0)
- leftArmWeld.C1=CFrame.new(0,0.5,0)
- equip()
- debounce=false
- end)
- script.Parent.Unequipped:connect(function()
- char=nil
- rightArmWeld:Remove()
- leftArmWeld:Remove()
- rightArmWeld=nil
- leftArmWeld=nil
- end)
- end))
- Part4.Name = "Flame"
- Part4.Parent = Tool0
- Part4.BrickColor = BrickColor.new("Bright red")
- Part4.Transparency = 1
- Part4.Size = Vector3.new(1.97999871, 0.640000284, 0.510000348)
- Part4.CFrame = CFrame.new(-3.19277, 0.801472008, -11.4081182, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part4.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Part4.Position = Vector3.new(-3.19277, 0.801472008, -11.4081182)
- Part4.Color = Color3.new(0.768628, 0.156863, 0.109804)
- SpecialMesh5.Parent = Part4
- SpecialMesh5.MeshType = Enum.MeshType.Sphere
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game.Players.LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement