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")
- 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(),Button2Up=fakeEvent(),Button2Down=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
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- 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 typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v 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 rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- 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")
- Animation1 = Instance.new("Animation")
- Part2 = Instance.new("Part")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Script6 = Instance.new("Script")
- Part7 = Instance.new("Part")
- ParticleEmitter8 = Instance.new("ParticleEmitter")
- ParticleEmitter9 = Instance.new("ParticleEmitter")
- ParticleEmitter10 = Instance.new("ParticleEmitter")
- BrickColorValue11 = Instance.new("BrickColorValue")
- Script12 = Instance.new("Script")
- Part13 = Instance.new("Part")
- BlockMesh14 = Instance.new("BlockMesh")
- Sound15 = Instance.new("Sound")
- Sound16 = Instance.new("Sound")
- Sound17 = Instance.new("Sound")
- Part18 = Instance.new("Part")
- BlockMesh19 = Instance.new("BlockMesh")
- Script20 = Instance.new("Script")
- LocalScript21 = Instance.new("LocalScript")
- Animation22 = Instance.new("Animation")
- Animation23 = Instance.new("Animation")
- LocalScript24 = Instance.new("LocalScript")
- Script25 = Instance.new("Script")
- ParticleEmitter26 = Instance.new("ParticleEmitter")
- Script27 = Instance.new("Script")
- Tool0.Name = "Chainsaw V2"
- Tool0.Parent = mas
- Tool0.GripForward = Vector3.new(-1, 0, -0)
- Tool0.GripRight = Vector3.new(0, 0, -1)
- Tool0.ToolTip = "dismember your foes."
- Tool0.CanBeDropped = false
- Animation1.Name = "Idle"
- Animation1.Parent = Tool0
- Animation1.AnimationId = "rbxassetid://464803828"
- Part2.Name = "Handle"
- Part2.Parent = Tool0
- Part2.BrickColor = BrickColor.new("Dark stone grey")
- Part2.Transparency = 1
- Part2.Rotation = Vector3.new(0, 0, 30)
- Part2.CanCollide = false
- Part2.FormFactor = Enum.FormFactor.Custom
- Part2.Size = Vector3.new(1.4000001, 0.799999833, 0.800000012)
- Part2.CFrame = CFrame.new(-22.7930222, 0.997788012, 160.439301, 0.865985394, -0.500054002, -6.49186632e-06, 0.500053346, 0.865984261, 3.29382347e-05, -1.08496006e-05, -3.17704616e-05, 0.999990821)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part2.Position = Vector3.new(-22.7930222, 0.997788012, 160.439301)
- Part2.Orientation = Vector3.new(0, 0, 30)
- Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Sound3.Name = "Equip"
- Sound3.Parent = Part2
- Sound3.SoundId = "rbxassetid://449578741"
- Sound3.Volume = 0.44999998807907
- Sound4.Name = "Idle"
- Sound4.Parent = Part2
- Sound4.SoundId = "rbxassetid://2766581"
- Sound4.Volume = 1
- Sound4.Looped = true
- Sound5.Name = "End"
- Sound5.Parent = Part2
- Sound5.Volume = 0.30000001192093
- Script6.Name = "Chainsaw"
- Script6.Parent = Tool0
- Script6.Disabled = true
- table.insert(cors,sandbox(Script6,function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 10
- local slash_damage = 25
- sword = script.Parent.Handle
- Tool = script.Parent
- Slashing = false
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset/?id=2766576"
- SlashSound.Parent = sword
- SlashSound.Volume = 1
- SlashSound.Pitch = 1
- function blow(hit)
- if (hit.Parent == nil) then return end -- happens when bullet hits sword
- local humanoid = hit.Parent:findFirstChild("Humanoid") or hit.Parent:findFirstChild("Zombie")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- -- final check, make sure sword is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
- tagHumanoid(humanoid, vPlayer)
- if Slashing == false then
- Slashing = true
- if hit.Name == "Head" or hit.Name == "Torso" then
- humanoid:TakeDamage(damage)
- Tool.Blade.Hit:Play()
- if hit.Parent:FindFirstChild("Torso") then
- hit.Parent.Torso.RotVelocity = hit.Parent.Torso.RotVelocity + Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
- end
- Tool.Bloodeh.Bloodieh.Enabled = true
- untagHumanoid(humanoid)
- wait(.05)
- Slashing = false
- elseif hit.Name == "Left Arm" or hit.Name == "Right Arm" or hit.Name == "Left Leg" or hit.Name == "Right Leg" then
- humanoid:TakeDamage(damage * .8)
- Tool.Blade.Hit:Play()
- if hit.Parent:FindFirstChild("Torso") then
- hit.Parent.Torso.RotVelocity = hit.Parent.Torso.RotVelocity + Vector3.new(math.random(-15,15),math.random(-15,15),math.random(-15,15))
- end
- Tool.Bloodeh.Bloodieh.Enabled = true
- untagHumanoid(humanoid)
- wait(.05)
- Slashing = false
- else
- humanoid:TakeDamage(damage * .2)
- Tool.Blade.Hit:Play()
- if hit.Parent:FindFirstChild("Torso") then
- hit.Parent.Torso.RotVelocity = hit.Parent.Torso.RotVelocity + Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- end
- Tool.Bloodeh.Bloodieh.Enabled = true
- Tool.Bloodeh.Materialleh.Enabled = true
- untagHumanoid(humanoid)
- wait(.05)
- Slashing = false
- end
- end
- end
- end
- elseif humanoid == nil and hum ~= nil then
- if hit.Transparency ~= 1 and hit.CanCollide ~= false then
- Tool.Bloodeh.OtherMaterialleh.Enabled = true
- Tool.Bloodeh.Materialleh.Enabled = true
- end
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- SlashSound:play()
- Slash()
- end
- function Slash()
- Tool.GripForward = Vector3.new(-1,0.2,0)
- Tool.GripPos = Vector3.new(0,0.1,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.4,0)
- Tool.GripPos = Vector3.new(0,0.2,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.5,0)
- Tool.GripPos = Vector3.new(0,0.3,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.8,0)
- Tool.GripPos = Vector3.new(0,0.4,0)
- wait()
- Tool.GripForward = Vector3.new(-1,1,0)
- Tool.GripPos = Vector3.new(0,0.5,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.8,0)
- Tool.GripPos = Vector3.new(0,0.4,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.6,0)
- Tool.GripPos = Vector3.new(0,0.3,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.4,0)
- Tool.GripPos = Vector3.new(0,0.2,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.2,0)
- Tool.GripPos = Vector3.new(0,0.1,0)
- wait()
- Tool.GripForward = Vector3.new(-1,0.0,0)
- Tool.GripPos = Vector3.new(0,0,0)
- wait()
- end
- Tool.Enabled = true
- local last_attack = 0
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- attack()
- wait(.1)
- Tool.Enabled = true
- end
- function onEquipped()
- sword.Start:Play()
- sword.Idle:Play()
- end
- function onUnequipped()
- sword.Idle:Stop()
- end
- function stopTouching(hit)
- if (hit.Parent == nil) then return end
- local humanoid = hit.Parent:findFirstChild("Humanoid") or hit.Parent:findFirstChild("Zombie")
- if humanoid then
- if hit.Name == "Head" or hit.Name == "Torso" or hit.Name == "Left Arm" or hit.Name == "Right Arm" or hit.Name == "Left Leg" or hit.Name == "Right Leg" then
- wait(.5)
- Tool.Bloodeh.Bloodieh.Enabled = false
- else
- wait(.5)
- Tool.Bloodeh.Bloodieh.Enabled = false
- Tool.Bloodeh.Materialleh.Enabled = false
- end
- else
- if hit.Transparency ~= 1 and hit.CanCollide ~= false then
- Tool.Bloodeh.OtherMaterialleh.Enabled = false
- Tool.Bloodeh.Materialleh.Enabled = false
- end
- end
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- script.Parent.Unequipped:connect(onUnequipped)
- connection = Tool.Blade.Touched:connect(blow)
- Tool.Blade.TouchEnded:connect(stopTouching)
- end))
- Part7.Name = "Bloodeh"
- Part7.Parent = Tool0
- Part7.Material = Enum.Material.SmoothPlastic
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Reflectance = 0.20000000298023
- Part7.Transparency = 1
- Part7.Rotation = Vector3.new(0, 90, 0)
- Part7.CanCollide = false
- Part7.FormFactor = Enum.FormFactor.Custom
- Part7.Size = Vector3.new(0.400000006, 0.800000012, 2.79999995)
- Part7.CFrame = CFrame.new(-25.6929703, 0.597774982, 160.439285, 3.70004273e-05, -3.00111951e-05, 1, -2.19997819e-05, 1, 3.00120118e-05, -1, -2.20008915e-05, 3.69997724e-05)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(-25.6929703, 0.597774982, 160.439285)
- Part7.Orientation = Vector3.new(0, 90, 0)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- ParticleEmitter8.Name = "Materialleh"
- ParticleEmitter8.Parent = Part7
- ParticleEmitter8.Transparency = NumberSequence.new(0.53750002384186,0.63749998807907,1)
- ParticleEmitter8.Rotation = NumberRange.new(-180, 180)
- ParticleEmitter8.Size = NumberSequence.new(0,0.4371589422226,0.38251399993896)
- ParticleEmitter8.Enabled = false
- ParticleEmitter8.Texture = "http://www.roblox.com/asset/?id=378184203"
- ParticleEmitter8.Lifetime = NumberRange.new(0.40000000596046, 0.80000001192093)
- ParticleEmitter8.Rate = 155
- ParticleEmitter8.RotSpeed = NumberRange.new(-600, 600)
- ParticleEmitter8.Speed = NumberRange.new(-2.5, 2.5)
- ParticleEmitter8.VelocitySpread = 15
- ParticleEmitter9.Name = "OtherMaterialleh"
- ParticleEmitter9.Parent = Part7
- ParticleEmitter9.Transparency = NumberSequence.new(0,0,0.13124996423721,0.32499998807907,0.64374995231628,1)
- ParticleEmitter9.Size = NumberSequence.new(0.21857976913452,0)
- ParticleEmitter9.Color = ColorSequence.new(Color3.new(1, 1, 0),Color3.new(1, 1, 0))
- ParticleEmitter9.Enabled = false
- ParticleEmitter9.LightEmission = 1
- ParticleEmitter9.Lifetime = NumberRange.new(0.30000001192093, 0.40000000596046)
- ParticleEmitter9.Rate = 150
- ParticleEmitter9.Speed = NumberRange.new(-6, 6)
- ParticleEmitter9.VelocitySpread = 45
- ParticleEmitter9.Color = ColorSequence.new(Color3.new(1, 1, 0),Color3.new(1, 1, 0))
- ParticleEmitter10.Name = "Bloodieh"
- ParticleEmitter10.Parent = Part7
- ParticleEmitter10.Transparency = NumberSequence.new(0,0.03125,0.16874998807907,0.42500001192093,1)
- ParticleEmitter10.Rotation = NumberRange.new(-180, 180)
- ParticleEmitter10.Size = NumberSequence.new(0,0.2732241153717,0)
- ParticleEmitter10.Color = ColorSequence.new(Color3.new(0.223529, 0.0156863, 0.0156863),Color3.new(0.517647, 0.0823529, 0.0823529))
- ParticleEmitter10.Enabled = false
- ParticleEmitter10.Texture = "http://www.roblox.com/asset/?id=241685484"
- ParticleEmitter10.Acceleration = Vector3.new(0, -5, 0)
- ParticleEmitter10.Lifetime = NumberRange.new(1, 2)
- ParticleEmitter10.Rate = 155
- ParticleEmitter10.RotSpeed = NumberRange.new(-600, 600)
- ParticleEmitter10.Speed = NumberRange.new(-2, 5)
- ParticleEmitter10.VelocitySpread = 35
- ParticleEmitter10.Color = ColorSequence.new(Color3.new(0.223529, 0.0156863, 0.0156863),Color3.new(0.517647, 0.0823529, 0.0823529))
- BrickColorValue11.Name = "WepColor"
- BrickColorValue11.Parent = Tool0
- BrickColorValue11.Value = BrickColor.new("Black")
- Script12.Name = "WepColorScript"
- Script12.Parent = BrickColorValue11
- table.insert(cors,sandbox(Script12,function()
- local Wep = script.Parent.Parent
- local WepColor = script.Parent
- function colorChange()
- for NO, wep in pairs(Wep:GetChildren()) do
- if wep.Name == "Color" or wep.Name == "HandleColor" then
- wep.BrickColor = WepColor.Value
- end
- end
- end
- colorChange()
- WepColor.Changed:connect(function(color)
- colorChange()
- end)
- end))
- Part13.Name = "Blade"
- Part13.Parent = Tool0
- Part13.Material = Enum.Material.SmoothPlastic
- Part13.BrickColor = BrickColor.new("Dark stone grey")
- Part13.Transparency = 1
- Part13.Rotation = Vector3.new(-39.0400009, 89.8099976, 39.0400009)
- Part13.CanCollide = false
- Part13.FormFactor = Enum.FormFactor.Custom
- Part13.Size = Vector3.new(0.400000095, 1, 2.80000019)
- Part13.CFrame = CFrame.new(-25.3929672, 0.597783983, 160.439301, 3.69998088e-05, -2.9999841e-05, 0.999994755, -2.19998565e-05, 0.999993443, 3.00006177e-05, -0.999990821, -2.20009078e-05, 3.69990048e-05)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.TopSurface = Enum.SurfaceType.Smooth
- Part13.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part13.Position = Vector3.new(-25.3929672, 0.597783983, 160.439301)
- Part13.Orientation = Vector3.new(0, 90, 0)
- Part13.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh14.Parent = Part13
- BlockMesh14.Scale = Vector3.new(0.200000003, 0.699999988, 1)
- BlockMesh14.Scale = Vector3.new(0.200000003, 0.699999988, 1)
- Sound15.Name = "Hit"
- Sound15.Parent = Part13
- Sound15.SoundId = "rbxassetid://2801263"
- Sound16.Name = "Rev2"
- Sound16.Parent = Part13
- Sound16.SoundId = "rbxassetid://2766576"
- Sound16.Volume = 1
- Sound17.Name = "Rev"
- Sound17.Parent = Part13
- Sound17.SoundId = "rbxassetid://2766576"
- Sound17.Volume = 1
- Sound17.Looped = true
- Part18.Parent = Tool0
- Part18.Material = Enum.Material.Metal
- Part18.BrickColor = BrickColor.new("Smoky grey")
- Part18.Rotation = Vector3.new(0, 89.8099976, 0)
- Part18.CanCollide = false
- Part18.Size = Vector3.new(0.539177597, 0.204020008, 1.04320586)
- Part18.CFrame = CFrame.new(-23.1392441, 0.210523993, 160.43924, 0, 0, 0.999994755, 0, 0.999993443, 0, -0.999990821, 0, 0)
- Part18.BottomSurface = Enum.SurfaceType.Smooth
- Part18.TopSurface = Enum.SurfaceType.Smooth
- Part18.Color = Color3.new(0.356863, 0.364706, 0.411765)
- Part18.Position = Vector3.new(-23.1392441, 0.210523993, 160.43924)
- Part18.Orientation = Vector3.new(0, 90, 0)
- Part18.Color = Color3.new(0.356863, 0.364706, 0.411765)
- BlockMesh19.Parent = Part18
- BlockMesh19.Scale = Vector3.new(1, 0.287261158, 1)
- BlockMesh19.Scale = Vector3.new(1, 0.287261158, 1)
- Script20.Name = "Weld"
- Script20.Parent = Tool0
- table.insert(cors,sandbox(Script20,function()
- function Weld(x,y)
- local W = Instance.new("Weld")
- W.Part0 = x
- W.Part1 = y
- local CJ = CFrame.new(x.Position)
- local C0 = x.CFrame:inverse()*CJ
- local C1 = y.CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = x
- end
- function Get(A)
- if A:IsA("BasePart") then
- if A.Name == "Left Arm" or A.Name == "Right Arm" then return end
- Weld(script.Parent.Handle, A)
- A.Anchored = false
- else
- local C = A:GetChildren()
- for i=1, #C do
- Get(C[i])
- end
- end
- end
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript21.Name = "AnotherWeld"
- LocalScript21.Parent = Tool0
- table.insert(cors,sandbox(LocalScript21,function()
- handle = script.Parent:WaitForChild("Handle")
- function Weld(x,y)
- local W = Instance.new("Weld")
- W.Part0 = x
- W.Part1 = y
- local CJ = CFrame.new(x.Position)
- local C0 = x.CFrame:inverse()*CJ
- local C1 = y.CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = x
- end
- function Get(A)
- if A:IsA("BasePart") then
- if A.Name == "Left Arm" or A.Name == "Right Arm" then return end
- Weld(script.Parent.Handle, A)
- A.Anchored = false
- else
- local C = A:GetChildren()
- for i=1, #C do
- Get(C[i])
- end
- end
- end
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- Animation22.Name = "Attack1"
- Animation22.Parent = Tool0
- Animation22.AnimationId = "rbxassetid://464822270"
- Animation23.Name = "Draw"
- Animation23.Parent = Tool0
- Animation23.AnimationId = "rbxassetid://464828610"
- LocalScript24.Name = "ChainsawScript"
- LocalScript24.Parent = Tool0
- table.insert(cors,sandbox(LocalScript24,function()
- function WaitForChild(parent,...)
- local debugPrint = false
- for _, i in ipairs({...}) do
- if type(i)=='boolean' then
- debugPrint = i
- else
- while not parent:FindFirstChild(i) do
- wait(1/30)
- if debugPrint then
- print(script.Name..':'..parent.Name..' Waiting for '.. i)
- end
- end
- parent=parent[i]
- end
- end
- return parent
- end
- local tool = script.Parent
- local user
- local Player
- anim1 = WaitForChild(tool,'Idle')
- anim2 = WaitForChild(tool,'Attack1')
- anim3 = WaitForChild(tool,'Draw')
- local idleanim
- local revanim
- local drawanim
- local hitconnected = false
- local buttondown = false
- local Camera = workspace.CurrentCamera
- local Handle = WaitForChild(tool,'Handle')
- local Blade = WaitForChild(tool,'Blade')
- local ImpactEffects = WaitForChild(tool,'Bloodeh')
- local equipped = false
- local CP, Torso
- local neck
- local necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- local defaultShoulder
- local defaultShoulder1
- local shoulder
- local shoulder1
- out = false
- empty = false
- reloading = false
- attacking = false
- local phys_stuff = PhysicalProperties.new(.7, .2, 1, .9, .975)
- impactsounds =
- {
- 2801263
- }
- impactsounds2 =
- {
- 10209596,
- 10209583
- }
- impactmeemsounds =
- {
- 227770957,
- 227770951,
- 227770948,
- 227770939
- }
- local getPos = function(Pos, TorsoPos)
- return Vector3.new(Pos.x, TorsoPos.y, Pos.z)
- end
- function tagHumanoid(hit,humanoid)
- local tag = hit:findFirstChild("creator")
- if tag then
- local new_tag = tag:Clone()
- new_tag.Parent = humanoid
- game.Debris:AddItem(new_tag,2)
- end
- end
- function Rev()
- if not equipped then return else
- if not attacking then
- attacking = true
- revanim:Play()
- Blade.Rev:Play()
- --Blade.Rev2:Play()
- --[[
- Blade.Rev.Pitch = 1
- for yes = 0,1, .1 do wait()
- Blade.Rev.Pitch = Blade.Rev.Pitch + .1
- end
- Blade.Rev.Pitch = 1
- ]]--
- while buttondown do
- wait(.1)
- end
- revanim:Stop()
- --[[
- for yes = 1,0, -.1 do wait()
- Blade.Rev.Pitch = Blade.Rev.Pitch - .1
- end
- Blade.Rev.Pitch = 0
- ]]--
- Blade.Rev:Stop()
- Blade.Rev2:Stop()
- wait(.3)
- attacking = false
- end
- end
- end
- function Turn(mouse, Torso)
- local offset = (Torso.Position.Y - mouse.Hit.p.Y)/80
- local mag =(Torso.Position - mouse.Hit.p).magnitude/80
- offset = offset / mag
- neck = Torso.Neck
- neck.C0 = necko * CFrame.fromEulerAnglesXYZ(offset,0,0)
- shoulder = Torso:FindFirstChild("Right Shoulder")
- if shoulder then
- shoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, -6.48200512e-007, 1.00000274, 0, -1.00000274, -6.48200512e-007, 0)*CFrame.fromEulerAnglesXYZ(0,0,-offset)
- end
- shoulder1 = Torso:FindFirstChild("Left Shoulder")
- if shoulder1 then
- shoulder1.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)*CFrame.fromEulerAnglesXYZ(0,0,offset)
- end
- end
- function clickhold(mouse)
- buttondown = true
- Rev()
- end
- function clickrelease()
- buttondown = false
- end
- tool.Equipped:connect(function(mouse)
- user = tool.Parent
- local debounce = false
- idleanim = user.Humanoid:LoadAnimation(anim1)
- revanim = user.Humanoid:LoadAnimation(anim2)
- drawanim = user.Humanoid:LoadAnimation(anim3)
- equipped = true
- spawn(function()
- mouse.TargetFilter = workspace
- Torso = user.Torso
- local Shoulder = Torso:FindFirstChild("Right Shoulder")
- if Shoulder then
- defaultShoulder = Shoulder.C0
- end
- local Shoulder1 = Torso:FindFirstChild("Left Shoulder")
- if Shoulder1 then
- defaultShoulder1 = Shoulder1.C0
- end
- mouse.Move:connect(function()
- if equipped and tool.Parent:FindFirstChild('Torso') then
- Turn(mouse,Torso)
- end
- end)
- mouse.Idle:connect(function()
- if equipped and tool.Parent:FindFirstChild('Torso') then
- Turn(mouse,Torso)
- wait()
- end
- end)
- user.Humanoid.Died:connect(function()
- Player.CameraMode = "Classic"
- neck.C0 = necko
- if shoulder then
- shoulder.C0 = defaultShoulder
- end
- if shoulder1 then
- shoulder1.C0 = defaultShoulder
- end
- end)
- end)
- Player = game.Players:GetPlayerFromCharacter(user)
- Player.CameraMode = "LockFirstPerson"
- --wait()
- arm = user["Right Arm"]
- arm1 = user["Left Arm"]
- fpArm2_0 = Instance.new("Model",workspace.CurrentCamera)
- if arm then
- FParm = arm:clone()
- FParm.Parent = fpArm2_0
- --tool.Arm:clone().Parent = FParm
- FParm.Material = "SmoothPlastic"
- local Weld = Instance.new("Weld",FParm)
- Weld.Part0 = FParm
- Weld.Part1 = arm
- local badweld = FParm:FindFirstChild("RightGrip")
- if badweld then badweld:Destroy() end
- end
- if arm1 then
- FParm1 = arm1:clone()
- FParm1.Parent = fpArm2_0
- --tool.Arm1:clone().Parent = FParm1
- FParm.Material = "SmoothPlastic"
- local Weld = Instance.new("Weld",FParm1)
- Weld.Part0 = FParm1
- Weld.Part1 = arm1
- end
- local armColor = user:FindFirstChild("Body Colors")
- if armColor then
- fpArmColor = armColor:Clone()
- fpArmColor.Parent = fpArm2_0
- armColor.Changed:connect(function()
- fpArmColor.LeftArmColor = armColor.LeftArmColor
- fpArmColor.RightArmColor = armColor.RightArmColor
- end)
- end
- local armShirt = user:FindFirstChild("Shirt")
- if armShirt then
- armShirt:Clone().Parent = fpArm2_0
- end
- for _,armMesh in pairs(user:GetChildren())do
- if armMesh.ClassName == "CharacterMesh" then
- armMesh:Clone().Parent = fpArm2_0
- end
- end
- local arms2_0hum = Instance.new("Humanoid",fpArm2_0)
- arms2_0hum.Health = 0
- arms2_0hum.MaxHealth = 0
- arms2_0hum.JumpPower = 0
- arms2_0hum.WalkSpeed = 0
- arms2_0hum.Sit = true
- arm.Changed:connect(function()
- FParm.Transparency = arm.Transparency
- FParm.Reflectance = arm.Reflectance
- end)
- arm1.Changed:connect(function()
- FParm1.Transparency = arm1.Transparency
- FParm1.Reflectance = arm1.Reflectance
- end)
- user.Humanoid.Died:connect(function()
- buttondown = false
- FParm:Destroy()
- FParm1:Destroy()
- user.Humanoid:UnequipTools()
- end)
- if mouse then mouse.Icon = "http://www.roblox.com/asset/?id=18662154" end
- Handle.Idle:Play()
- Handle.Equip:Play()
- if drawanim then drawanim:Play() end
- wait(drawanim.Length - .1)
- if not equipped then return else
- if idleanim then idleanim:Play() end
- wait(.2)
- if mouse then
- mouse.Button1Down:connect(clickhold)
- mouse.Button1Up:connect(clickrelease)
- end
- Blade.Touched:connect(function(hit)
- if attacking then
- if user.Humanoid.Health > 1 then
- if hit.Name == "Handle" or hit.Transparency > .9 then return else
- if not debounce then
- debounce = true
- if hit.Parent then
- if not hit.Parent.ClassName == "Hat" then return else
- local freeman = hit.Parent:FindFirstChild("Humanoid")
- if freeman then
- if freeman ~= user.Humanoid then -- don't hit yourself, idiot.
- tagHumanoid(hit,freeman)
- freeman:TakeDamage(15)
- Blade.Hit:Play()
- local impactsound = Instance.new("Sound",Blade)
- impactsound.Volume = 1
- ImpactEffects.Bloodieh.Enabled = true
- ImpactEffects.OtherMaterialleh.Enabled = false
- ImpactEffects.Materialleh.Enabled = false
- if freeman.Parent.Name == "MeeM" or freeman:FindFirstChild("MeeM") then
- freeman:TakeDamage(50)
- end
- if freeman.Health < .1 then
- local limbs = math.random(1,5)
- if limbs == 1 then
- print("amputation")
- print ("hit.Name = "..hit.Name)
- if (hit.Name == "Head") or (hit.Name == "Left Leg") or (hit.Name == "Right Leg") or (hit.Name == "Left Arm") or (hit.Name == "Right Arm") then
- print ("check1")
- if not hit:FindFirstChild("Gib") then
- print("check2")
- local material_random = math.random(1,5)
- local color_random = math.random(1,2)
- local ded = Instance.new("ObjectValue",hit)
- ded.Name = "Gib"
- hit.Parent = workspace
- hit.CanCollide = true
- hit:ClearAllChildren()
- hit:BreakJoints()
- hit.FormFactor = "Custom"
- hit.CustomPhysicalProperties = phys_stuff
- local size_random = math.random(1,5)
- if size_random == 1 then
- hit.Size = Vector3.new(0.6,1,1)
- elseif size_random == 2 then
- hit.Size = Vector3.new(2,0.4,1.2)
- elseif size_random == 3 then
- hit.Size = Vector3.new(0.4,1.8,0.4)
- elseif size_random == 4 then
- hit.Size = Vector3.new(0.8,0.8,0.8)
- else
- hit.Size = Vector3.new(1.2,0.6,1.8)
- end
- hit.Name = "gib"
- local squick = Instance.new("Sound",hit)
- squick.Volume = 1
- squick.SoundId = "rbxassetid://268941254"
- squick:Play()
- local blood = script.Blood:Clone()
- blood.Enabled = true
- blood.Parent = hit
- hit.Velocity = Vector3.new(math.random(-15,15),math.random(20,40),math.random(-15,15))
- hit.RotVelocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
- if color_random == 1 then
- hit.BrickColor = BrickColor.new("Crimson")
- else
- hit.BrickColor = BrickColor.new("Maroon")
- end
- if material_random == 1 then
- hit.Material = Enum.Material.Slate
- elseif material_random == 2 then
- hit.Material = Enum.Material.Pebble
- elseif material_random == 3 then
- hit.Material = Enum.Material.Marble
- elseif material_random == 4 then
- hit.Material = Enum.Material.Grass
- else
- hit.Material = Enum.Material.Cobblestone
- end
- script.GibSmack:Clone().Parent = hit
- game.Debris:AddItem(hit,25)
- end
- end
- end
- end
- hit.RotVelocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
- impactsound.Pitch = math.random(100,115)/100
- impactsound.SoundId = "rbxassetid://"..impactsounds[math.random(1,#impactsounds)]
- impactsound:Play()
- game.Debris:AddItem(impactsound,impactsound.TimeLength)
- end
- else
- ImpactEffects.Bloodieh.Enabled = false
- ImpactEffects.OtherMaterialleh.Enabled = true
- ImpactEffects.Materialleh.Enabled = true
- end
- end
- else
- ImpactEffects.Bloodieh.Enabled = false
- ImpactEffects.OtherMaterialleh.Enabled = true
- ImpactEffects.Materialleh.Enabled = true
- end
- --wait()
- debounce = false
- end
- end
- end
- end
- end)
- Blade.TouchEnded:connect(function(hit)
- if hit.Transparency < 1 and hit.CanCollide then
- wait(.5)
- ImpactEffects.Bloodieh.Enabled = false
- ImpactEffects.OtherMaterialleh.Enabled = false
- ImpactEffects.Materialleh.Enabled = false
- end
- end)
- end
- end)
- tool.Unequipped:connect(function()
- buttondown = false
- equipped = false
- if idleanim then idleanim:Stop() end
- if revanim then revanim:Stop() end
- if drawanim then drawanim:Stop() end
- if idleanim then idleanim:Destroy() end
- if revanim then revanim:Destroy() end
- if drawanim then drawanim:Destroy() end
- Handle.Idle:Stop()
- Handle.End:Play()
- fpArm2_0:Destroy()
- Player.CameraMode = "Classic"
- neck.C0 = necko
- if shoulder then
- shoulder.C0 = defaultShoulder
- end
- if shoulder1 then
- shoulder1.C0 = defaultShoulder1
- end
- end)
- end))
- Script25.Name = "GibSmack"
- Script25.Parent = LocalScript24
- table.insert(cors,sandbox(Script25,function()
- if script.Parent:IsA("BasePart") then
- fall = true
- fallpain = Instance.new("Sound",script.Parent)
- fallpain.Volume = .8
- trip_debounce = false
- local Delay = 0
- local min_trip_height = 2.5
- local max_trip_height = 22.5
- script.Parent.Touched:connect(function(hit)
- if hit.CanCollide then
- if fall then
- if not trip_debounce then
- trip_debounce = true
- if script.Parent.Velocity.Magnitude > min_trip_height and script.Parent.Velocity.Magnitude < max_trip_height then
- Delay = .2
- if fall then
- local randomsound = math.random(1,4)
- if randomsound == 1 then
- fallpain.SoundId = "rbxassetid://198502131"
- elseif randomsound == 2 then
- fallpain.SoundId = "rbxassetid://198502222"
- elseif randomsound == 3 then
- fallpain.SoundId = "rbxassetid://198502242"
- else
- fallpain.SoundId = "rbxassetid://198502334"
- end
- end
- fallpain:Play()
- elseif script.Parent.Velocity.Magnitude > max_trip_height then
- Delay = .35
- if fall then
- local randomsound = math.random(1,6)
- if randomsound == 1 then
- fallpain.SoundId = "rbxassetid://268596081"
- elseif randomsound == 2 then
- fallpain.SoundId = "rbxassetid://268596094"
- elseif randomsound == 3 then
- fallpain.SoundId = "rbxassetid://268596113"
- elseif randomsound == 4 then
- fallpain.SoundId = "rbxassetid://268596131"
- elseif randomsound == 5 then
- fallpain.SoundId = "rbxassetid://268596154"
- else
- fallpain.SoundId = "rbxassetid://268596164"
- end
- end
- fallpain:Play()
- end
- wait(Delay)
- trip_debounce = false
- end
- else return end
- end
- end)
- else return end
- end))
- ParticleEmitter26.Name = "Blood"
- ParticleEmitter26.Parent = LocalScript24
- ParticleEmitter26.Transparency = NumberSequence.new(0,0.18125000596046,0.13124999403954,0.32499998807907,0.41874998807907,0.46250000596046,0.52499997615814,0.81875002384186,1)
- ParticleEmitter26.Rotation = NumberRange.new(-20, 20)
- ParticleEmitter26.Size = NumberSequence.new(0,0.68749994039536,0.5,0)
- ParticleEmitter26.Enabled = false
- ParticleEmitter26.Texture = "http://www.roblox.com/asset/?id=183599976"
- ParticleEmitter26.ZOffset = 0.5
- ParticleEmitter26.Acceleration = Vector3.new(0, -5, 0)
- ParticleEmitter26.Lifetime = NumberRange.new(1, 2)
- ParticleEmitter26.Rate = 50
- ParticleEmitter26.RotSpeed = NumberRange.new(-150, 150)
- ParticleEmitter26.Speed = NumberRange.new(2.5, 2.5)
- Script27.Name = "blood loss ew"
- Script27.Parent = ParticleEmitter26
- table.insert(cors,sandbox(Script27,function()
- local blood = script.Parent
- local gibs = blood.Parent
- if gibs then
- if gibs:IsA("BasePart") then
- wait(5)
- repeat
- blood.Acceleration = Vector3.new(math.random(-3.5,3.5),-5,math.random(-3.5,3.5))
- blood.Rate = blood.Rate -1
- --[[
- if blood.Rate > 25 then
- wait(.5)
- elseif blood.Rate < 10 then
- wait(1)
- else
- wait(.75)
- end
- ]]
- wait()
- until blood.Rate < 1
- blood.Enabled = false
- end
- end
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("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