Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer 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=1489994942"
- SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=213956852"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(0.30, 0.30, 0.30)
- 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