Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- local RealPlayer = Player
- do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end,__call=function(self,...)local t=rawget(self,"_RealService")if t then return t(...)end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return self[t]end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;x.RunService=v({RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")setmetatable(x,{__index=function(self,t)return r:GetService(t)or typeof(r[t])=="function"and function(m,...)return r[t](r,...)end or r[t]end,__newindex=s.__newindex,__call=s.__call})game,owner=x,x.Players.LocalPlayer end
- --Getting the player, character and mouse
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local Mouse = plr:GetMouse()
- local mtarget
- --Making the tool
- local gun = Instance.new("Tool",plr.Backpack)
- gun.Name = "weapon"
- gun.GripPos = Vector3.new(0, -1.315, -0.253)
- gun.GripUp = Vector3.new(0, -0, 1)
- local handle = Instance.new("Part",gun)
- handle.Name = "Handle"
- handle.Size = Vector3.new(0.3, 4.9, 0.8)
- local mesh = Instance.new("SpecialMesh",handle)
- mesh.MeshId = "http://www.roblox.com/asset/?id=42583419"
- mesh.MeshType = "FileMesh"
- mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
- mesh.TextureId = "http://www.roblox.com/asset/?id=42584198"
- local bullet = Instance.new("Model",gun)
- bullet.Name = "bullet"
- local p1 = Instance.new("Part",bullet)
- p1.Shape = "Ball"
- p1.Name = "p1"
- p1.Size = Vector3.new(0.9, 0.9, 0.9)
- p1.Material = "Neon"
- p1.BrickColor = BrickColor.new("Really blue")
- p1.Transparency = 1
- p1.CanCollide = false
- p1.BottomSurface = "Smooth"
- p1.TopSurface = "Smooth"
- local p2 = Instance.new("Part",bullet)
- p2.Shape = "Ball"
- p2.Name = "p2"
- p2.Size = Vector3.new(1, 1, 1)
- p2.Material = "Plastic"
- p2.BrickColor = BrickColor.new("Institutional white")
- p2.Transparency = 1
- p2.CanCollide = false
- p2.BottomSurface = "Smooth"
- p2.TopSurface = "Smooth"
- local shoot = Instance.new("Sound",handle)
- shoot.SoundId = "rbxassetid://2344851316"
- shoot.Volume = 1
- local canshoot = false
- --Making the welds
- local w1 = Instance.new("Weld",p1)
- w1.Part0 = p1
- w1.Part1 = handle
- w1.C0 = CFrame.new(0, 0, 0, 1, 1.19208686e-07, -2.72848411e-12, 1.19208686e-07, 1, 1.15107923e-12, -2.72848411e-12, 1.15107923e-12, 1)
- w1.C1 = CFrame.new(-0.0999778807, 3.69987226, 0.299981654, 1, 1.19208686e-07, -2.72848411e-12, 1.19208686e-07, 1, 1.15107923e-12, -2.72848411e-12, 1.15107923e-12, 1)
- w1.Name = "hWeld"
- local w2 = Instance.new("Weld",p1)
- w2.Part0 = p1
- w2.Part1 = p2
- w2.C0 = CFrame.new(0.299996376, -5.29999924, 1.5, 0.999998569, 5.96042923e-07, -1.36423997e-11, 5.96043094e-07, 1, 5.75538922e-12, -1.36423997e-11, 5.75538749e-12, 0.999998569)
- w2.C1 = CFrame.new(0.300022125, -5.30012798, 1.49998176, 1, 1.19208686e-07, -2.72848411e-12, 1.19208686e-07, 1, 1.15107923e-12, -2.72848411e-12, 1.15107923e-12, 1)
- --Functions
- gun.Equipped:connect(function()
- local weld = Instance.new("Weld",char)
- weld.Name = "Weld"
- weld.Part0 = char.Torso
- weld.Part1 = char["Left Arm"]
- weld.C1 = CFrame.new(0.199999988, 0.699999988, 0, 0.642787516, 7.6651645e-09, -0.766044438, 0.766044438, 9.13498788e-09, 0.642787516, 1.19248806e-08, -0.99999994, -5.21253064e-16)
- weld.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- local weld2 = Instance.new("Weld",char)
- weld2.Part0 = char.Torso
- weld2.Part1 = char["Right Arm"]
- weld2.C1 = CFrame.new(0, 0.49999997, 0, -4.37113847e-08, 0, 0.99999994, -1, -4.37113847e-08, -4.37113883e-08, 4.37113883e-08, -0.99999994, 1.91068547e-15)
- weld2.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- weld2.Name = "Weld2"
- canshoot = true
- end)
- gun.Unequipped:connect(function()
- char.Weld:Destroy()
- char.Weld2:Destroy()
- canshoot = false
- end)
- function clickObj()
- if canshoot == true then
- mtarget = Mouse.Target
- if mtarget then
- shoot:Play()
- local bulc = bullet:Clone()
- bulc.Parent = game.Workspace
- bulc.p1.Transparency = 0.5
- bulc.p2.Transparency = 0.5
- bulc.p1.hWeld:Destroy()
- bulc.p2.CanCollide = true
- local bv = Instance.new("BodyVelocity")
- bv.Parent = bulc.p2
- bv.velocity = ((char.Humanoid.TargetPoint - bulc.p2.Position).unit) * 50
- function onTouched(brick)
- local humn = brick.Parent:FindFirstChildOfClass("Humanoid")
- if humn then
- if humn.Parent ~= char then
- if humn.Name ~= "killed" then
- local par = humn.Parent
- for i,v in pairs(par:GetChildren()) do
- if v.ClassName == "Script" or v.ClassName == "LocalScript" or v.ClassName == "ModuleScript" or v.ClassName == "CharacterMesh" then
- v:Destroy()
- end
- end
- par.Torso["Right Hip"].Part1 = nil
- par.Torso["Left Hip"].Part1 = nil
- par.Torso["Right Shoulder"].Part1 = nil
- par.Torso["Left Shoulder"].Part1 = nil
- for i,v in pairs(par:GetChildren()) do
- if v.ClassName == "Part" then
- v.BrickColor = BrickColor.new("Institutional white")
- v.Material = "Neon"
- if v.Name == "limb" then
- v:Destroy()
- end
- end
- end
- for i,v in pairs(par.Head:GetChildren()) do
- if v.ClassName == "Decal" then
- v:Destroy()
- end
- end
- for i,v in pairs(par.Head:GetChildren()) do
- if v.ClassName == "Part" then
- v.Anchored = false
- end
- end
- for i,v in pairs(par:GetChildren()) do
- if v.ClassName == "Hat" or v.ClassName == "Accessory" then
- v.Handle.BrickColor = BrickColor.new("Institutional white")
- v.Handle.Material = "Neon"
- for i,v in pairs(v.Handle:GetChildren()) do
- if v.ClassName == "SpecialMesh" then
- v.TextureId = ""
- end
- end
- end
- end
- humn.Name = "killed"
- local bp = Instance.new("BodyPosition",par["Right Arm"])
- bp.Position = par["Right Arm"].Position
- bp.Position = bp.Position + Vector3.new(0,8,0)
- local bp = Instance.new("BodyPosition",par["Left Leg"])
- bp.Position = par["Left Leg"].Position
- bp.Position = bp.Position + Vector3.new(0,4,0)
- local bp = Instance.new("BodyPosition",par.Torso)
- bp.Position = par.Torso.Position
- bp.Position = bp.Position + Vector3.new(0,2,0)
- local bp = Instance.new("BodyPosition",par["Left Arm"])
- bp.Position = par["Left Arm"].Position
- bp.Position = bp.Position + Vector3.new(0,2,0)
- local bp = Instance.new("BodyPosition",par["Right Leg"])
- bp.Position = par["Right Leg"].Position
- bp.Position = bp.Position + Vector3.new(0,2,0)
- local rac = Instance.new("Part",par)
- rac.Size = Vector3.new(1,1,1)
- rac.Position = par["Right Arm"].Position
- rac.Name = "limb"
- rac.Transparency = 1
- local w = Instance.new("Weld",rac)
- w.Part0 = par["Right Arm"]
- w.Part1 = rac
- w.C0 = CFrame.new(0,-0.5,0)
- local lac = Instance.new("Part",par)
- lac.Size = Vector3.new(1,1,1)
- lac.Position = par["Left Arm"].Position
- lac.Name = "limb"
- lac.Transparency = 1
- local w = Instance.new("Weld",lac)
- w.Part0 = par["Left Arm"]
- w.Part1 = lac
- w.C0 = CFrame.new(0,-0.5,0)
- local rlc = Instance.new("Part",par)
- rlc.Size = Vector3.new(1,1,1)
- rlc.Position = par["Right Leg"].Position
- rlc.Name = "limb"
- rlc.Transparency = 1
- local w = Instance.new("Weld",rlc)
- w.Part0 = par["Right Leg"]
- w.Part1 = rlc
- w.C0 = CFrame.new(0,-0.5,0)
- local llc = Instance.new("Part",par)
- llc.Size = Vector3.new(1,1,1)
- llc.Position = par["Right Leg"].Position
- llc.Name = "limb"
- llc.Transparency = 1
- local w = Instance.new("Weld",llc)
- w.Part0 = par["Left Leg"]
- w.Part1 = llc
- w.C0 = CFrame.new(0,-0.5,0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = par.Torso
- Joint.Part1 = par["Right Arm"]
- Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = par.Torso
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = par.Torso
- Joint.Part1 = par["Left Arm"]
- Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = par.Torso
- local Joint = Instance.new("Glue")
- Joint.Name = "RightHip"
- Joint.Part0 = par.Torso
- Joint.Part1 = par["Right Leg"]
- Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = par.Torso
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = par.Torso
- Joint.Part1 = par["Left Leg"]
- Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = par.Torso
- humn.PlatformStand = true
- wait(4.5)
- for i,v in pairs(par:GetChildren()) do
- if v.ClassName == "Part" then
- local w1 = Instance.new("WedgePart",workspace)
- w1.Size = Vector3.new(0.5,0.5,0.5)
- w1.Position = v.Position
- w1.Material = "Neon"
- local w2 = Instance.new("WedgePart",workspace)
- w2.Size = Vector3.new(0.5,0.5,0.5)
- w2.Position = v.Position
- w2.Material = "Neon"
- v:Destroy()
- end
- end
- end
- bulc:Destroy()
- end
- end
- end
- bulc.p2.Touched:connect(onTouched)
- end
- end
- end
- Mouse.Button1Down:connect(clickObj)
Add Comment
Please, Sign In to add comment