Advertisement
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,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
- local rp = RealPlayer
- script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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 then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- 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 Mouse = Player:GetMouse()
- 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,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- 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)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then return s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- wait(1)
- ---------------------------[[[ VARIABLES ]]]---------------------------
- local plr = game.Players.LocalPlayer
- local chr = plr.Character
- local mou = plr:GetMouse()
- local leftarm = false
- local active = false
- local curkey = "f"
- local stunneds = {}
- ---------------------------[[[ PARTS ]]]---------------------------
- -- 1 - Glock
- obj1 = Instance.new("Model")
- obj1.Name = "Glock"
- obj1.Parent = chr
- -- 2 - Part
- obj2 = Instance.new("Part")
- obj2.CFrame = CFrame.new(Vector3.new(14.25, 3.51428652, 46.8584824)) * CFrame.Angles(0.69812995195389, 0, -0)
- obj2.TopSurface = Enum.SurfaceType.Smooth
- obj2.BottomSurface = Enum.SurfaceType.Smooth
- obj2.Material = Enum.Material.Metal
- obj2.Size = Vector3.new(0.300000012, 0.200000003, 0.200000003)
- obj2.Anchored = true
- obj2.BrickColor = BrickColor.new("Black")
- obj2.Friction = 0.30000001192093
- obj2.Shape = Enum.PartType.Block
- obj2.CanCollide = false
- obj2.Parent = obj1
- -- 3 - Top
- obj3 = Instance.new("Part")
- obj3.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
- obj3.TopSurface = Enum.SurfaceType.Smooth
- obj3.BottomSurface = Enum.SurfaceType.Smooth
- obj3.Material = Enum.Material.Metal
- obj3.Size = Vector3.new(0.300000012, 0.300000012, 1.5)
- obj3.Anchored = true
- obj3.BrickColor = BrickColor.new("Ghost grey")
- obj3.Friction = 0.30000001192093
- obj3.Shape = Enum.PartType.Block
- obj3.CanCollide = false
- obj3.Name = "Top"
- obj3.Parent = obj1
- -- 4 - Top
- obj4 = Instance.new("Part")
- obj4.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj4.TopSurface = Enum.SurfaceType.Smooth
- obj4.BottomSurface = Enum.SurfaceType.Smooth
- obj4.Material = Enum.Material.Metal
- obj4.Size = Vector3.new(0.200000003, 0.299999982, 0.300000012)
- obj4.Anchored = true
- obj4.BrickColor = BrickColor.new("Ghost grey")
- obj4.Friction = 0.30000001192093
- obj4.Shape = Enum.PartType.Cylinder
- obj4.Name = "Top"
- obj4.CanCollide = false
- obj4.Parent = obj1
- -- 5 - Part
- obj5 = Instance.new("Part")
- obj5.CFrame = CFrame.new(Vector3.new(14.25, 3.35359001, 47.1499939)) * CFrame.Angles(-1.5707978010178, 0, -0)
- obj5.TopSurface = Enum.SurfaceType.Smooth
- obj5.BottomSurface = Enum.SurfaceType.Smooth
- obj5.Material = Enum.Material.Metal
- obj5.Size = Vector3.new(0.300000012, 0.200000003, 0.299999982)
- obj5.Anchored = true
- obj5.BrickColor = BrickColor.new("Black")
- obj5.Friction = 0.30000001192093
- obj5.Shape = Enum.PartType.Block
- obj5.CanCollide = false
- obj5.Parent = obj1
- -- 6 - Part
- obj6 = Instance.new("Part")
- obj6.CFrame = CFrame.new(Vector3.new(14.25, 3.5999999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
- obj6.TopSurface = Enum.SurfaceType.Smooth
- obj6.BottomSurface = Enum.SurfaceType.Smooth
- obj6.Material = Enum.Material.Metal
- obj6.Size = Vector3.new(0.300000012, 0.200000003, 1.5)
- obj6.Anchored = true
- obj6.BrickColor = BrickColor.new("Black")
- obj6.CanCollide = false
- obj6.Friction = 0.30000001192093
- obj6.Shape = Enum.PartType.Block
- obj6.Parent = obj1
- -- 7 - Part
- obj7 = Instance.new("Part")
- obj7.CFrame = CFrame.new(Vector3.new(14.25, 3.60000014, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
- obj7.TopSurface = Enum.SurfaceType.Smooth
- obj7.BottomSurface = Enum.SurfaceType.Smooth
- obj7.Material = Enum.Material.Metal
- obj7.Size = Vector3.new(0.200000003, 0.200000003, 0.300000012)
- obj7.Anchored = true
- obj7.BrickColor = BrickColor.new("Black")
- obj7.CanCollide = false
- obj7.Friction = 0.30000001192093
- obj7.Shape = Enum.PartType.Cylinder
- obj7.Parent = obj1
- -- 8 - Part
- obj8 = Instance.new("Part")
- obj8.CFrame = CFrame.new(Vector3.new(14.25, 3.15358996, 46.8499985)) * CFrame.Angles(1.1920913323138e-007, 0, -0)
- obj8.TopSurface = Enum.SurfaceType.Smooth
- obj8.BottomSurface = Enum.SurfaceType.Smooth
- obj8.Material = Enum.Material.Metal
- obj8.Size = Vector3.new(0.300000012, 0.200000003, 0.699999988)
- obj8.Anchored = true
- obj8.BrickColor = BrickColor.new("Black")
- obj8.Friction = 0.30000001192093
- obj8.CanCollide = false
- obj8.Shape = Enum.PartType.Block
- obj8.Parent = obj1
- -- 9 - Part
- obj9 = Instance.new("Part")
- obj9.CFrame = CFrame.new(Vector3.new(14.25, 3.27858996, 46.5067024)) * CFrame.Angles(-1.0471963882446, 0, -0)
- obj9.TopSurface = Enum.SurfaceType.Smooth
- obj9.BottomSurface = Enum.SurfaceType.Smooth
- obj9.Material = Enum.Material.Metal
- obj9.Size = Vector3.new(0.300000012, 0.300000012, 0.699999988)
- obj9.Anchored = true
- obj9.BrickColor = BrickColor.new("Black")
- obj9.CanCollide = false
- obj9.Friction = 0.30000001192093
- obj9.Shape = Enum.PartType.Block
- obj9.Parent = obj1
- local previous = nil
- for i,v in pairs(obj1:GetChildren()) do
- if v:IsA('BasePart') then
- if previous then
- local weld = Instance.new('Weld',v)
- weld.Part0 = v
- weld.Part1 = previous
- weld.C0 = v.CFrame:inverse() * previous.CFrame
- previous.Anchored = false
- end
- previous = v
- end
- end
- previous.Anchored = false
- ---------------------------[[[ FUNCTIONS ]]]---------------------------
- function notify(msg,forever)
- local doit = coroutine.wrap(function()
- for i,v in pairs(plr.PlayerGui:GetChildren()) do
- if v.Name == "Notification" and v:IsA('ScreenGui') then
- v:Destroy()
- end
- end
- local gui = Instance.new('ScreenGui',plr.PlayerGui)
- gui.Name = "Notification"
- local frame = Instance.new('Frame',gui)
- frame.Position = UDim2.new(0,0,0,0)
- frame.Size = UDim2.new(1,0,0.2,0)
- frame.BackgroundTransparency = 1
- local txt = Instance.new('TextLabel',frame)
- txt.TextColor3 = Color3.new(255,255,255)
- txt.TextStrokeColor3 = Color3.new(0, 0, 0)
- txt.TextStrokeTransparency = 0
- txt.BackgroundTransparency = 1
- txt.Text = ""
- txt.Size = UDim2.new(1,0,0.3,0)
- txt.Position = UDim2.new(0,0,0.4,0)
- txt.TextScaled = true
- txt.Font = "Code"
- txt.TextXAlignment = "Center"
- local tap = Instance.new("Sound")
- tap.Parent = plr.Backpack
- tap.SoundId = "rbxassetid://147982968"
- tap.TimePosition = 0.1
- local str = msg
- local len = string.len(str)
- for i=1,len do
- txt.Text = string.sub(str,1,i)
- local pitche = math.random(2, 4)
- tap.PlaybackSpeed = pitche
- tap:Play()
- wait(0.05)
- end
- if forever == false then
- wait(1)
- while txt.TextTransparency < 1 do
- txt.TextTransparency = txt.TextTransparency + 0.1
- txt.TextStrokeTransparency = txt.TextStrokeTransparency + 0.1
- wait()
- end
- gui:Destroy()
- end
- end)
- doit()
- end
- function damage(playa,hita)
- local hitz = hita.Name
- local heyy = hitz
- if hitz == "Right Arm" then
- local Limb = playa:FindFirstChild("Right Arm")
- local ters = playa:FindFirstChild('Torso')
- if Limb and ters then
- if ters:FindFirstChild('Right Shoulder') then ters["Right Shoulder"]:Destroy() end
- for i,v in pairs(Limb:GetChildren()) do
- if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
- v:Destroy()
- end
- end
- Limb.CFrame = ters.CFrame * CFrame.new(1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = ters
- Joint.Part1 = Limb
- 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 = ters
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- elseif hitz == "Left Arm" then
- local Limb = playa:FindFirstChild("Left Arm")
- local ters = playa:FindFirstChild('Torso')
- if Limb and ters then
- if ters:FindFirstChild('Left Shoulder') then ters["Left Shoulder"]:Destroy() end
- for i,v in pairs(Limb:GetChildren()) do
- if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
- v:Destroy()
- end
- end
- Limb.CFrame = ters.CFrame * CFrame.new(-1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = ters
- Joint.Part1 = Limb
- 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 = ters
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = ters
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- elseif hitz == "Right Leg" then
- local Limb = playa:FindFirstChild("Right Leg")
- local ters = playa:FindFirstChild('Torso')
- if Limb and ters then
- if ters:FindFirstChild('Right Hip') then ters["Right Hip"]:Destroy() end
- for i,v in pairs(Limb:GetChildren()) do
- if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
- v:Destroy()
- end
- end
- Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "Right Hip"
- Joint.Part0 = ters
- Joint.Part1 = Limb
- 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 = ters
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- if playa:FindFirstChildOfClass('Humanoid') then
- local hum = playa:FindFirstChildOfClass('Humanoid')
- local target = playa
- if target:FindFirstChild('HumanoidRootPart') then
- target.HumanoidRootPart:Destroy()
- end
- local found = false
- for i,v in pairs(stunneds) do
- if v == hum then
- found = true
- end
- end
- if found == false then
- table.insert(stunneds,hum)
- end
- end
- end
- elseif hitz == "Left Leg" then
- local Limb = playa:FindFirstChild("Left Leg")
- local ters = playa:FindFirstChild('Torso')
- if Limb and ters then
- if ters:FindFirstChild('Left Hip') then ters["Left Hip"]:Destroy() end
- for i,v in pairs(Limb:GetChildren()) do
- if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
- v:Destroy()
- end
- end
- Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
- Limb.CFrame = ters.CFrame * CFrame.new(-0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = ters
- Joint.Part1 = Limb
- 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 = ters
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- Limb.CanCollide = false
- if playa:FindFirstChildOfClass('Humanoid') then
- local hum = playa:FindFirstChildOfClass('Humanoid')
- local target = playa
- if target:FindFirstChild('HumanoidRootPart') then
- target.HumanoidRootPart:Destroy()
- end
- local found = false
- for i,v in pairs(stunneds) do
- if v == hum then
- found = true
- end
- end
- if found == false then
- table.insert(stunneds,hum)
- end
- end
- end
- else
- local playa2 = playa
- playa.Archivable = true
- local playa = playa:Clone()
- playa.Archivable = false
- playa2:Destroy()
- playa.Parent = workspace
- local Gibs = game.Workspace
- print(playa)
- local Torso = playa.Torso
- local Head = playa:FindFirstChild("Head")
- local function Scan(ch)
- local e
- for e = 1,#ch do
- Scan(ch[e]:GetChildren())
- if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
- ch[e]:remove()
- end
- end
- end
- Scan(playa:GetChildren())
- if playa:FindFirstChild('HumanoidRootPart') then
- playa:FindFirstChild('HumanoidRootPart'):Destroy()
- end
- local hum2 = playa:FindFirstChildOfClass("Humanoid")
- if hum2 ~= nil then
- hum2.Name = "Humanoid2"
- hum2.PlatformStand = true
- hum2.Health = 0
- end
- local ch = playa:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- if Head then
- local Neck = Instance.new("Weld")
- Neck.Name = "Neck"
- Neck.Part0 = Torso
- Neck.Part1 = Head
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Neck.C1 = CFrame.new()
- Neck.Parent = Torso
- end
- local Limb = playa:FindFirstChild("Right Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- 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 = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = playa:FindFirstChild("Left Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- 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 = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = playa:FindFirstChild("Right Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- 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 = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = playa:FindFirstChild("Left Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- 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 = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = playa
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- --[
- local Bar = Instance.new("Part")
- Bar.TopSurface = 0
- Bar.BottomSurface = 0
- Bar.formFactor = "Symmetric"
- Bar.Size = Vector3.new(1, 1, 1)
- Bar.Transparency = 1
- Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
- Bar.Parent = playa
- local Weld = Instance.new("Weld")
- Weld.Part0 = Torso
- Weld.Part1 = Bar
- Weld.C0 = CFrame.new(0, 0.5, 0)
- Weld.Parent = Torso
- --]]
- playa.Parent = Gibs
- game.Debris:AddItem(playa, 12)
- end
- end
- function calculate()
- if leftarm and chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Left Shoulder") and chr:FindFirstChild('Left Arm') then
- local Head = plr.Character.Head
- local RightShoulder = plr.Character.Torso["Left Shoulder"]
- local RightArm = plr.Character["Left Arm"]
- local MousePosition = mou.Hit.p
- local ToMouse = (MousePosition - Head.Position).unit
- local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
- local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((-Head.Size.X / 2) + (-RightArm.Size.X / 2)), ((-Head.Size.Y / 2) - (-RightArm.Size.Z / 2)), 0)))
- local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(-1 ,0, -1)).unit
- local Look = (Head.CFrame.lookVector * Vector3.new(-1, 0, -1)).unit
- local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
- if tostring(LateralAngle) == "-1.#IND" then
- LateralAngle = 0
- end
- local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
- --[[
- if LateralAngle > (math.pi / 2) then
- LateralAngle = (math.pi / 2)
- if chr:FindFirstChild('Torso') then
- local Torso = chr.Torso
- local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
- if Point.Z > 0 then
- if Point.X > 0 then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
- elseif Point.X < 0 then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
- end
- end
- end
- end
- ]]--
- print(LateralAngle)
- warn(math.pi / 2)
- if Cross.Y < 0 then
- LateralAngle = -LateralAngle
- end
- return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
- elseif chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Right Shoulder") and chr:FindFirstChild('Right Arm') then
- local Head = plr.Character.Head
- local RightShoulder = plr.Character.Torso["Right Shoulder"]
- local RightArm = plr.Character["Right Arm"]
- local MousePosition = mou.Hit.p
- local ToMouse = (MousePosition - Head.Position).unit
- local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
- local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0)))
- local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
- local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
- local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
- if tostring(LateralAngle) == "-1.#IND" then
- LateralAngle = 0
- end
- local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
- if LateralAngle > (math.pi / 2) then
- LateralAngle = (math.pi / 2)
- if chr:FindFirstChild('Torso') then
- local Torso = chr.Torso
- local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
- if Point.Z > 0 then
- if Point.X > 0 then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
- elseif Point.X < 0 then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
- end
- end
- end
- end
- if Cross.Y < 0 then
- LateralAngle = -LateralAngle
- end
- return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
- end
- end
- function fire()
- if mou.Target then
- local humanoid = mou.Target.Parent:FindFirstChildOfClass("Humanoid")
- if not humanoid then
- humanoid = mou.Target.Parent.Parent:FindFirstChildOfClass("Humanoid")
- end
- if humanoid then
- local coru = coroutine.wrap(function()
- damage(humanoid.Parent,mou.Target)
- end)
- coru()
- end
- end
- local beam = Instance.new("Part", workspace)
- beam.BrickColor = BrickColor.new("Bright yellow")
- beam.FormFactor = "Custom"
- beam.Material = "Neon"
- beam.Transparency = 0.25
- beam.Anchored = true
- beam.Locked = true
- beam.CanCollide = false
- local distance = (obj4.CFrame.p - mou.Hit.p).magnitude
- beam.Size = Vector3.new(0.2, 0.2, distance)
- beam.CFrame = CFrame.new(obj4.CFrame.p, mou.Hit.p) * CFrame.new(0, 0, -distance / 2)
- game:GetService("Debris"):AddItem(beam, 0.05)
- local sound = Instance.new('Sound',obj4)
- sound.SoundId = 'rbxassetid://139593133'
- sound.Volume = 3
- sound.EmitterSize = 40
- sound.MaxDistance = 450
- sound:Play()
- game:GetService("Debris"):AddItem(beam, sound.TimeLength)
- end
- ---------------------------[[[ SCRIPT ]]]---------------------------
- if chr:FindFirstChild('Left Arm') == nil or chr:FindFirstChild('Torso') == nil or chr.Torso:FindFirstChild('Left Shoulder') == nil then
- leftarm = false
- end
- local weldas = Instance.new('Weld',obj2)
- if leftarm and chr:FindFirstChild('Left Arm') then
- weldas.Part0 = obj2
- weldas.Part1 = chr["Left Arm"]
- weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
- elseif chr:FindFirstChild('Right Arm') then
- weldas.Part0 = obj2
- weldas.Part1 = chr["Right Arm"]
- weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
- end
- if leftarm and chr:FindFirstChild('Left Arm') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild('Left Shoulder') then
- chr:FindFirstChild('Left Arm').AncestryChanged:connect(function(me,par)
- if par ~= chr and chr:FindFirstChild('Right Arm') then
- if obj2 and obj2:FindFirstChildOfClass('Weld') then
- obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
- end
- leftarm = false
- end
- end)
- chr.Torso:FindFirstChild('Left Shoulder').AncestryChanged:connect(function(me,par)
- if par ~= chr:FindFirstChild('Torso') and chr:FindFirstChild('Right Arm') then
- if obj2 and obj2:FindFirstChildOfClass('Weld') then
- obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
- end
- end
- leftarm = false
- end)
- elseif leftarm then
- if obj2 and obj2:FindFirstChildOfClass('Weld') and chr:FindFirstChild('Right Arm') then
- obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
- end
- end
- mou.KeyDown:connect(function(key)
- if key == string.lower(curkey) then
- active = not active
- end
- end)
- plr.Chatted:connect(function(msg)
- if string.lower(string.sub(msg,1,5)) == "!bind" then
- curkey = string.lower(string.sub(msg,7,7))
- notify([[Changed key for equip/unequip to "]]..curkey..[[".]],false)
- end
- end)
- game:GetService('RunService').Stepped:connect(function()
- if active and chr:FindFirstChild('Torso') then
- if leftarm then
- chr.Torso["Left Shoulder"].C0 = calculate()
- else
- chr.Torso["Right Shoulder"].C0 = calculate()
- end
- weldas.Part1 = chr["Right Arm"]
- weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
- elseif chr:FindFirstChild('Torso') and (chr.Torso:FindFirstChild('Left Shoulder') or chr.Torso:FindFirstChild('Right Shoulder')) then
- if leftarm then
- chr.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0)*CFrame.Angles(0,-math.pi/2,0)
- else
- chr.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0)*CFrame.Angles(0,math.pi/2,0)
- end
- weldas.Part1 = chr.Torso
- weldas.C0 = CFrame.new(-1,0,-1)*CFrame.Angles(math.rad(-90),0,0)
- end
- for i,v in pairs(stunneds) do
- v.PlatformStand = true
- end
- end)
- mou.Button1Down:connect(function()
- if active then
- fire()
- end
- end)
- notify([[Chat "!bind [key]" to bind a different key to equip/unequip. Current key is "f".]],false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement