Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --By Rufus14
- --owner = game:GetService("Players"):GetPlayerFromCharacter(script.Parent)
- character = owner.Character
- NLS([[
- --By Rufus14
- owner = game:GetService("Players").LocalPlayer
- character = owner.Character
- runservice = game:GetService("RunService")
- humanoid = character:findFirstChildOfClass("Humanoid")
- remote = character:WaitForChild("postalremote")
- rootpart = character.HumanoidRootPart
- mouse = owner:GetMouse()
- mouse.Button1Down:connect(function()
- remote:FireServer("shoot", mouse.Hit)
- end)
- mouse.KeyDown:connect(function(key)
- key = key:lower()
- if key == "x" then
- remote:FireServer("well hello there")
- end
- end)
- while runservice.RenderStepped:wait() do
- remote:FireServer("look", workspace.CurrentCamera.CFrame)
- end
- ]], character)
- runservice = game:GetService("RunService")
- humanoid = character:findFirstChildOfClass("Humanoid")
- local remote = Instance.new("RemoteEvent", character)
- remote.Name = "postalremote"
- ragdolltime = 2
- local rightleg = Instance.new("Weld", owner.Character.Torso)
- rightleg.Part0 = owner.Character.Torso
- rightleg.Part1 = owner.Character["Right Leg"]
- rightleg.C0 = CFrame.new(0.5,-2,0)
- rightleg.Name = "RightLegWeld"
- local leftleg = Instance.new("Weld", owner.Character.Torso)
- leftleg.Part0 = owner.Character.Torso
- leftleg.Part1 = owner.Character["Left Leg"]
- leftleg.C0 = CFrame.new(-0.5,-1,0)
- leftleg.Name = "LeftLegWeld"
- local rightarm = Instance.new("Weld", owner.Character.Torso)
- rightarm.Part0 = owner.Character.Torso
- rightarm.Part1 = owner.Character["Right Arm"]
- rightarm.C0 = CFrame.new(1.5,0,0)
- rightarm.Name = "RightArmWeld"
- local leftarm = Instance.new("Weld", owner.Character.Torso)
- leftarm.Part0 = owner.Character.Torso
- leftarm.Part1 = owner.Character["Left Arm"]
- leftarm.C0 = CFrame.new(-1.5,0,0)
- leftarm.Name = "LeftArmWeld"
- local humanoidrootpart = Instance.new("Weld", owner.Character.HumanoidRootPart)
- humanoidrootpart.Part0 = owner.Character.HumanoidRootPart
- humanoidrootpart.Part1 = owner.Character.Torso
- humanoidrootpart.Name = "HumanoidRootPartWeld"
- local head = Instance.new("Weld", owner.Character.Torso)
- head.Part0 = owner.Character.Torso
- head.Part1 = owner.Character.Head
- head.C0 = CFrame.new(0,1.5,0)
- head.Name = "HeadWeld"
- rootpart = character.HumanoidRootPart
- anim = "idle"
- humanoid.WalkSpeed = 20
- for i,v in pairs(character:GetChildren()) do
- if v.ClassName == "Shirt" or v.ClassName == "Pants" or v.ClassName == "ShirtGraphic" then
- v:destroy()
- end
- if v.ClassName == "Part" and v.Name ~= "Head" then
- v.BrickColor = BrickColor.new("Smoky grey")
- end
- end
- owner.Chatted:connect(function(butwhathechatted)
- if character.Head:findFirstChild("chat") then
- character.Head:findFirstChild("chat"):destroy()
- end
- local billboard = Instance.new("BillboardGui", character.Head)
- billboard.Adornee = character.Head
- billboard.StudsOffset = Vector3.new(-1, 2.5, 0)
- billboard.Size = UDim2.new(2,0,1,0)
- billboard.Name = "chat"
- local text = Instance.new("TextLabel", billboard)
- text.BackgroundTransparency = 1
- text.TextStrokeTransparency = 0
- text.TextSize = 25
- text.TextStrokeColor3 = Color3.fromRGB(0,0,0)
- text.Size = billboard.Size
- text.Font = "Code"
- text.TextColor3 = Color3.fromRGB(100,100,100)
- text.Text = butwhathechatted
- coroutine.wrap(function()
- wait(3)
- for i = 1,50 do
- billboard.StudsOffset = billboard.StudsOffset - Vector3.new(0,-0.01,0)
- text.TextTransparency = text.TextTransparency + 0.02
- text.TextStrokeTransparency = text.TextStrokeTransparency + 0.02
- runservice.Stepped:wait()
- end
- billboard:destroy()
- end)()
- end)
- local shirt = Instance.new("Shirt", character)
- shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=161053461"
- shirt.Color3 = Color3.fromRGB(0,0,0)
- local pants = Instance.new("Pants", character)
- pants.PantsTemplate = "http://www.roblox.com/asset/?id=161053481"
- pants.Color3 = Color3.fromRGB(0,0,0)
- local glasses = Instance.new("Part", character)
- glasses.Size = Vector3.new(1,1,1)
- glasses.CanCollide = false
- glasses:BreakJoints()
- local meshglasses = Instance.new("SpecialMesh", glasses)
- meshglasses.MeshId = "http://www.roblox.com/asset/?id=1577360"
- meshglasses.TextureId = "http://www.roblox.com/asset/?id=48385919"
- meshglasses.Scale = Vector3.new(1,1.3,1)
- local weldglasses = Instance.new("Weld", glasses)
- weldglasses.Part0 = character.Head
- weldglasses.Part1 = glasses
- weldglasses.C0 = CFrame.new(0,0.15,-0.15)
- local shotgun = Instance.new("Part", character)
- shotgun.Size = Vector3.new(0.26, 1.11, 4.85)
- shotgun.CanCollide = false
- local meshshotgun = Instance.new("SpecialMesh", shotgun)
- meshshotgun.MeshId = "http://www.roblox.com/asset/?id=94219391"
- meshshotgun.TextureId = "http://www.roblox.com/asset/?id=94219470"
- meshshotgun.Scale = Vector3.new(0.75,0.75,0.75)
- shotgun:BreakJoints()
- local weldshotgun = Instance.new("Weld", shotgun)
- weldshotgun.Part0 = character["Right Arm"]
- weldshotgun.Part1 = shotgun
- weldshotgun.C0 = CFrame.new(0,-0.5,-0.25)
- weldshotgun.C0 = weldshotgun.C0 * CFrame.Angles(-math.pi/2,0,0)
- local music = Instance.new("Sound", character.Head)
- music.Looped = true
- music.Volume = 2
- shootsound = Instance.new("Sound", shotgun)
- shootsound.SoundId = "rbxassetid://2452443974"
- shootsound.Volume = 1
- local hitmarkersound = Instance.new("Sound", shotgun)
- hitmarkersound.SoundId = "rbxassetid://160432334"
- hitmarkersound.Volume = 0.5
- local musicrandom = math.random(1,2)
- if musicrandom == 1 then
- music.SoundId = "rbxassetid://4380119612"
- elseif musicrandom == 2 then
- music.SoundId = "rbxassetid://4433374633"
- end
- music:Play()
- shotgun.Locked = true
- glasses.Locked = true
- cananimate = true
- canattack = true
- coroutine.wrap(function()
- while runservice.Stepped:wait() do
- if rootpart.Velocity.x >= 2 or rootpart.Velocity.x <= -2 or rootpart.Velocity.z >= 2 or rootpart.Velocity.z <= -2 then
- if humanoid.FloorMaterial == Enum.Material.Air then
- if rootpart.Velocity.x >= 15.5 or rootpart.Velocity.x <= -15.5 or rootpart.Velocity.z >= 15.5 or rootpart.Velocity.z <= -15.5 then
- if rootpart.Velocity.y >= 3 then
- anim = "jumprun"
- --print("jumping (running)")
- elseif rootpart.Velocity.y <= -3 then
- anim = "fallrun"
- --("falling (running)")
- end
- else
- if rootpart.Velocity.y >= 3 then
- anim = "jump"
- --print("jumping (walking)")
- elseif rootpart.Velocity.y <= -3 then
- anim = "fall"
- --print("falling (walking)")
- end
- end
- else
- if rootpart.Velocity.x >= 15 or rootpart.Velocity.x <= -15 or rootpart.Velocity.z >= 15 or rootpart.Velocity.z <= -15 then
- anim = "run"
- --print("running")
- else
- anim = "run"
- --print("walking")
- end
- end
- elseif rootpart.Velocity.x <= 2 or rootpart.Velocity.x >= -2 or rootpart.Velocity.z <= 2 or rootpart.Velocity.z >= -2 then
- if humanoid.FloorMaterial == Enum.Material.Air then
- if rootpart.Velocity.y >= 3 then
- anim = "jump"
- --print("jumping (standing)")
- elseif rootpart.Velocity.y < -3 then
- anim = "fall"
- --print("falling (standing)")
- end
- else
- anim = "idle"
- --print("standing")
- end
- end
- end
- end)()
- local tiltvalue = 0
- function ragdollplr(v)
- if not v:findFirstChild("ragdolledpostal") then
- local head = v.Head
- local torso = v:findFirstChild("Torso")
- local humanoid = v:findFirstChildOfClass("Humanoid")
- hitmarkersound:Play()
- local ragdolledknife = Instance.new("BoolValue", v)
- ragdolledknife.Name = "ragdolledpostal"
- local velocity = Instance.new("BodyVelocity", head)
- velocity.MaxForce = Vector3.new(math.huge,0,math.huge)
- velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * math.random(10,20)
- humanoid.PlatformStand = true
- coroutine.wrap(function()
- wait(ragdolltime)
- humanoid.PlatformStand = false
- end)()
- game.Debris:AddItem(ragdolledknife, ragdolltime)
- game.Debris:AddItem(velocity, 0.2)
- if torso then
- coroutine.wrap(function()
- humanoid = v:WaitForChild("Humanoid")
- local ragdoll = v
- if ragdoll:findFirstChild("Right Arm") then
- local glue = Instance.new("Glue", ragdoll.Torso)
- glue.Part0 = ragdoll.Torso
- glue.Part1 = ragdoll:findFirstChild("Right Arm")
- glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm"))
- limbcollider.Size = Vector3.new(1.4,1,1)
- limbcollider.Shape = "Cylinder"
- limbcollider.Transparency = 1
- limbcollider.Name = "LimbCollider"
- local limbcolliderweld = Instance.new("Weld", limbcollider)
- limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm")
- limbcolliderweld.Part1 = limbcollider
- limbcolliderweld.Name = "LimbWeld"
- limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
- coroutine.wrap(function()
- if ragdoll.Torso:findFirstChild("Right Shoulder") then
- local limbclone = ragdoll.Torso:findFirstChild("Right Shoulder"):Clone()
- ragdoll.Torso:findFirstChild("Right Shoulder"):destroy()
- coroutine.wrap(function()
- wait(ragdolltime)
- if not ragdoll:findFirstChild("Torso") then
- return
- end
- limbclone.Parent = ragdoll.Torso
- limbclone.Part0 = ragdoll.Torso
- limbclone.Part1 = ragdoll["Right Arm"]
- end)()
- end
- wait(ragdolltime)
- glue:destroy()
- limbcollider:destroy()
- limbcolliderweld:destroy()
- end)()
- end
- if ragdoll:findFirstChild("Left Arm") then
- local glue = Instance.new("Glue", ragdoll.Torso)
- glue.Part0 = ragdoll.Torso
- glue.Part1 = ragdoll:findFirstChild("Left Arm")
- glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm"))
- limbcollider.Size = Vector3.new(1.4,1,1)
- limbcollider.Shape = "Cylinder"
- limbcollider.Name = "LimbCollider"
- limbcollider.Transparency = 1
- local limbcolliderweld = Instance.new("Weld", limbcollider)
- limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm")
- limbcolliderweld.Part1 = limbcollider
- limbcolliderweld.Name = "LimbWeld"
- limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
- coroutine.wrap(function()
- if ragdoll.Torso:findFirstChild("Left Shoulder") then
- local limbclone = ragdoll.Torso:findFirstChild("Left Shoulder"):Clone()
- ragdoll.Torso:findFirstChild("Left Shoulder"):destroy()
- coroutine.wrap(function()
- wait(ragdolltime)
- if not ragdoll:findFirstChild("Torso") then
- return
- end
- limbclone.Parent = ragdoll.Torso
- limbclone.Part0 = ragdoll.Torso
- limbclone.Part1 = ragdoll["Left Arm"]
- end)()
- end
- wait(ragdolltime)
- glue:destroy()
- limbcollider:destroy()
- limbcolliderweld:destroy()
- end)()
- end
- if ragdoll:findFirstChild("Left Leg") then
- local glue = Instance.new("Glue", ragdoll.Torso)
- glue.Part0 = ragdoll.Torso
- glue.Part1 = ragdoll:findFirstChild("Left Leg")
- glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg"))
- limbcollider.Size = Vector3.new(1.5,1,1)
- limbcollider.Shape = "Cylinder"
- limbcollider.Name = "LimbCollider"
- limbcollider.Transparency = 1
- local limbcolliderweld = Instance.new("Weld", limbcollider)
- limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg")
- limbcolliderweld.Part1 = limbcollider
- limbcolliderweld.Name = "LimbWeld"
- limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
- coroutine.wrap(function()
- if ragdoll.Torso:findFirstChild("Left Hip") then
- local limbclone = ragdoll.Torso:findFirstChild("Left Hip"):Clone()
- ragdoll.Torso:findFirstChild("Left Hip"):destroy()
- coroutine.wrap(function()
- wait(ragdolltime)
- if not ragdoll:findFirstChild("Torso") then
- return
- end
- limbclone.Parent = ragdoll.Torso
- limbclone.Part0 = ragdoll.Torso
- limbclone.Part1 = ragdoll["Left Leg"]
- end)()
- end
- wait(ragdolltime)
- glue:destroy()
- limbcollider:destroy()
- limbcolliderweld:destroy()
- end)()
- end
- if ragdoll:findFirstChild("Right Leg") then
- local glue = Instance.new("Glue", ragdoll.Torso)
- glue.Part0 = ragdoll.Torso
- glue.Part1 = ragdoll:findFirstChild("Right Leg")
- glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg"))
- limbcollider.Size = Vector3.new(1.5,1,1)
- limbcollider.Shape = "Cylinder"
- limbcollider.Name = "LimbCollider"
- limbcollider.Transparency = 1
- local limbcolliderweld = Instance.new("Weld", limbcollider)
- limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg")
- limbcolliderweld.Part1 = limbcollider
- limbcolliderweld.Name = "LimbWeld"
- limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0)
- coroutine.wrap(function()
- if ragdoll.Torso:findFirstChild("Right Hip") then
- local limbclone = ragdoll.Torso:findFirstChild("Right Hip"):Clone()
- ragdoll.Torso:findFirstChild("Right Hip"):destroy()
- coroutine.wrap(function()
- wait(ragdolltime)
- if not ragdoll:findFirstChild("Torso") then
- return
- end
- limbclone.Parent = ragdoll.Torso
- limbclone.Part0 = ragdoll.Torso
- limbclone.Part1 = ragdoll["Right Leg"]
- end)()
- end
- wait(ragdolltime)
- glue:destroy()
- limbcollider:destroy()
- limbcolliderweld:destroy()
- end)()
- end
- end)()
- end
- end
- end
- remote.OnServerEvent:connect(function(plr, what, message, message2)
- if plr == owner then
- if what == "look" then
- local lookvector = owner.Character.Torso.CFrame:toObjectSpace(message).lookVector.unit
- head.C0 = CFrame.new(0,1,0) * CFrame.Angles(lookvector.y,0,0)
- head.C0 = head.C0 * CFrame.Angles(0,-lookvector.x,math.rad(-tiltvalue))
- head.C0 = head.C0 * CFrame.new(0,0.5,0)
- elseif what == "shoot" and canattack then
- canattack = false
- cananimate = false
- humanoid.WalkSpeed = 0
- for i = 0,1 , 0.08 do
- rootpart.CFrame = rootpart.CFrame:lerp(CFrame.new(rootpart.Position, Vector3.new(message.x,rootpart.Position.y,message.z)),i)
- weldshotgun.C0 = weldshotgun.C0:lerp(CFrame.new(0,-1,-0.35) * CFrame.Angles(-math.pi/2,0,0),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.21384871, 0.500000477, -0.879925251, 0.342019856, 0.939692438, -1.49501886e-08, 1.94707184e-07, -2.68220873e-07, -0.999999821, -0.939692438, 0.342020035, -3.76157232e-07),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.59201181, 0.470158577, -0.794548988, 0.271118939, 0.181368172, 0.945304275, 0.902039766, -0.390578717, -0.18377316, 0.335885108, 0.902526498, -0.269494623) * CFrame.new(0.1,0,0.5),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,(-math.pi/2)+math.rad(20),0), i)
- tiltvalue = tiltvalue + 0.5
- runservice.Stepped:wait()
- end
- shootsound:Play()
- shootsound.TimePosition = 0.1
- local light = Instance.new("PointLight", shotgun)
- game.Debris:AddItem(light, 0.1)
- for i = 1,5 do
- local bullet = Instance.new("Part", character.Head)
- bullet.Size = Vector3.new(0.1,0.1,4)
- bullet.Material = "Neon"
- bullet.Name = "bullet"
- bullet.CanCollide = false
- bullet.CFrame = shotgun.CFrame * CFrame.new(0,0.2,-4)
- bullet.CFrame = CFrame.new(bullet.Position, message.p)
- game.Debris:AddItem(bullet, 5)
- local velocity = Instance.new("BodyVelocity", bullet)
- velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- velocity.Velocity = bullet.CFrame.lookVector * 800 + Vector3.new(math.random(-40,40),math.random(-40,40),0)
- bullet.Touched:connect(function(what)
- if what ~= nil then
- if what.Parent ~= nil and what.Name ~= "bullet" then
- if what.Parent:findFirstChildOfClass("Humanoid") then
- if what.Parent ~= character then
- hitmarkersound:Play()
- local hum = what.Parent:findFirstChildOfClass("Humanoid")
- local damage = math.random(30,110)
- if hum.Health > 500 then
- hum.Health = 500
- hum.MaxHealth = 500
- end
- if hum.Health <= damage then
- if not what.Parent:findFirstChild("ragdolledpostal") then
- --print("critical health")
- if math.random(1,3) == 1 and what.Parent:findFirstChild("HumanoidRootPart") then
- if not what.Parent:findFirstChild("dying") then
- if what.Parent:findFirstChild("Torso") then
- coroutine.wrap(function()
- Instance.new("BoolValue", what.Parent).Name = "dying"
- --print("lean")
- ragdollplr(what.Parent)
- if what.Parent:findFirstChild("Health") then
- what.Parent:findFirstChild("Health").Disabled = true
- end
- hum.Health = 10
- hum.Name = "im hurt help"
- local vhum = hum
- wait(ragdolltime)
- local vrightarm = Instance.new("Weld", what.Parent.Torso)
- vrightarm.Part0 = what.Parent.Torso
- vrightarm.Part1 = what.Parent["Right Arm"]
- vrightarm.C0 = CFrame.new(1.5,0,0)
- vrightarm.Name = "RightArmWeld"
- local vrightleg = Instance.new("Weld", what.Parent.Torso)
- vrightleg.Part0 = what.Parent.Torso
- vrightleg.Part1 = what.Parent["Right Leg"]
- vrightleg.C0 = CFrame.new(0.5,-2,0)
- vrightleg.Name = "RightLegWeld"
- local vleftarm = Instance.new("Weld", what.Parent.Torso)
- vleftarm.Part0 = what.Parent.Torso
- vleftarm.Part1 = what.Parent["Left Arm"]
- vleftarm.C0 = CFrame.new(-1.5,0,0)
- vleftarm.Name = "LeftArmWeld"
- local vleftleg = Instance.new("Weld", what.Parent.Torso)
- vleftleg.Part0 = what.Parent.Torso
- vleftleg.Part1 = what.Parent["Left Leg"]
- vleftleg.C0 = CFrame.new(-0.5,-2,0)
- vleftleg.Name = "LeftLegWeld"
- local vhead = Instance.new("Weld", what.Parent.Torso)
- vhead.Part0 = what.Parent.Torso
- vhead.Part1 = what.Parent.Head
- vhead.C0 = CFrame.new(0,1.5,0)
- vhead.Name = "HeadWeld"
- local vhumanoidrootpart = Instance.new("Weld", what.Parent.HumanoidRootPart)
- vhumanoidrootpart.Part0 = what.Parent.HumanoidRootPart
- vhumanoidrootpart.Part1 = what.Parent.Torso
- vhumanoidrootpart.Name = "HumanoidRootPartWeld"
- local vrootpart = what.Parent.HumanoidRootPart
- coroutine.wrap(function()
- for i = 0,1 , 0.05 do
- vrootpart.CFrame = vrootpart.CFrame:lerp(CFrame.new(vrootpart.Position),i)
- end
- end)()
- local vanim = "idle"
- coroutine.wrap(function()
- while runservice.Stepped:wait() do
- vhum.JumpPower = 0
- vhum.WalkSpeed = 2
- if vrootpart.Velocity.x >= 0.1 or vrootpart.Velocity.x <= -0.1 or vrootpart.Velocity.z >= 0.1 or vrootpart.Velocity.z <= -0.1 then
- if vhum.FloorMaterial == Enum.Material.Air then
- if vrootpart.Velocity.x >= 15.5 or vrootpart.Velocity.x <= -15.5 or vrootpart.Velocity.z >= 15.5 or vrootpart.Velocity.z <= -15.5 then
- if vrootpart.Velocity.y >= 3 then
- vanim = "jumprun"
- --print("jumping (running)")
- elseif vrootpart.Velocity.y <= -3 then
- vanim = "fallrun"
- --("falling (running)")
- end
- else
- if vrootpart.Velocity.y >= 3 then
- vanim = "jump"
- --print("jumping (walking)")
- elseif vrootpart.Velocity.y <= -3 then
- vanim = "fall"
- --print("falling (walking)")
- end
- end
- else
- if vrootpart.Velocity.x >= 15.5 or vrootpart.Velocity.x <= -15.5 or vrootpart.Velocity.z >= 15.5 or vrootpart.Velocity.z <= -15.5 then
- vanim = "run"
- --print("running")
- else
- vanim = "walk"
- --print("walking")
- end
- end
- elseif vrootpart.Velocity.x <= 0.1 or vrootpart.Velocity.x >= -0.1 or vrootpart.Velocity.z <= 0.1 or vrootpart.Velocity.z >= -0.1 then
- if vhum.FloorMaterial == Enum.Material.Air then
- if vrootpart.Velocity.y >= 3 then
- vanim = "jump"
- --print("jumping (standing)")
- elseif vrootpart.Velocity.y < -3 then
- vanim = "fall"
- --print("falling (standing)")
- end
- else
- vanim = "idle"
- --print("standing")
- end
- end
- end
- end)()
- local dyinganim = math.random(1,3)
- local larmrand = math.random(0,80)
- local rarmrand = math.random(0,80)
- local llegrand = math.random(0,30)
- local rlegrand = math.random(0,30)
- coroutine.wrap(function()
- while vhum.Health > 0.005 do
- vhum.Health = vhum.Health - 0.005
- runservice.Stepped:wait()
- end
- if dyinganim == 3 then
- dyinganim = 0
- for i = 0,1 , 0.02 do
- vhumanoidrootpart.C0 = vhumanoidrootpart.C0:lerp(CFrame.new(0,-2.5,0) * CFrame.Angles(-math.pi/2,0,rootpart.RotVelocity.y/50),i)
- vhead.C0 = vhead.C0:lerp(CFrame.new(0,1.5,0),i)
- vleftarm.C0 = vleftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi,0,-math.rad(larmrand)) * CFrame.new(0,-0.5,0),i)
- vrightarm.C0 = vrightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi,0,math.rad(rarmrand)) * CFrame.new(0,-0.5,0),i)
- vleftleg.C0 = vleftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(0,0,-math.rad(llegrand)) * CFrame.new(0,-1,0),i)
- vrightleg.C0 = vrightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.Angles(0,0,math.rad(rlegrand)) * CFrame.new(0,-1,0),i)
- vhum.WalkSpeed = 0
- runservice.Stepped:wait()
- end
- end
- vhum.WalkSpeed = 0
- wait(1)
- vhum.Parent.Archivable = true
- vhum.Health = 0
- local vclone = vhum.Parent:Clone()
- for q,w in pairs(vhum.Parent:GetDescendants()) do
- if w.ClassName == "Part" or w.ClassName == "MeshPart" then
- w:destroy()
- end
- end
- vclone.Parent = workspace
- for q,w in pairs(vclone:GetDescendants()) do
- if w.ClassName == "Sound" then
- w:destroy()
- end
- end
- end)()
- coroutine.wrap(function()
- while runservice.Stepped:wait() do
- if dyinganim == 1 then
- if vanim == "idle" then
- vhumanoidrootpart.C0 = vhumanoidrootpart.C0:lerp(CFrame.new(0,-2.5,0) * CFrame.Angles(-math.pi/2,0,rootpart.RotVelocity.y/50),0.1)
- vhead.C0 = vhead.C0:lerp(CFrame.new(0,1.5,0),0.1)
- vleftarm.C0 = vleftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi,0,-math.rad(larmrand)) * CFrame.new(0,-0.5,0),0.1)
- vrightarm.C0 = vrightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi,0,math.rad(rarmrand)) * CFrame.new(0,-0.5,0),0.1)
- vleftleg.C0 = vleftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(0,0,-math.rad(llegrand)) * CFrame.new(0,-1,0),0.1)
- vrightleg.C0 = vrightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.Angles(0,0,math.rad(rlegrand)) * CFrame.new(0,-1,0),0.1)
- elseif vanim == "walk" then
- vhumanoidrootpart.C0 = vhumanoidrootpart.C0:lerp(CFrame.new(0,-2.5,0) * CFrame.Angles(-math.pi/2,0,math.cos(tick()*7)/8),0.1)
- vhead.C0 = vhead.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles((math.pi/2)-math.rad(20),0,0) * CFrame.new(0,0.5,0),0.1)
- vleftarm.C0 = vleftarm.C0:lerp(CFrame.new(-1.5,0.5+math.sin(tick()*7)/3,0) * CFrame.Angles(math.pi,0,-math.rad(larmrand)+math.cos(tick()*7)/3) * CFrame.new(0,-0.5,0),0.1)
- vrightarm.C0 = vrightarm.C0:lerp(CFrame.new(1.5,0.5-math.sin(tick()*7)/3,0) * CFrame.Angles(math.pi,0,math.rad(rarmrand)-math.cos(tick()*7)/3) * CFrame.new(0,-0.5,0),0.1)
- vleftleg.C0 = vleftleg.C0:lerp(CFrame.new(-0.5,-1-math.sin(tick()*7)/3,0) * CFrame.Angles(0,0,-math.rad(llegrand)) * CFrame.new(0,-1,0),0.1)
- vrightleg.C0 = vrightleg.C0:lerp(CFrame.new(0.5,-1+math.sin(tick()*7)/3,0) * CFrame.Angles(0,0,math.rad(rlegrand)) * CFrame.new(0,-1,0),0.1)
- end
- elseif dyinganim == 2 then
- if vanim == "idle" then
- vhumanoidrootpart.C0 = vhumanoidrootpart.C0:lerp(CFrame.new(0,-2.5,0) * CFrame.Angles(-math.pi/2,0,rootpart.RotVelocity.y/50),0.1)
- vhead.C0 = vhead.C0:lerp(CFrame.new(0,1.5,0),0.1)
- vleftarm.C0 = vleftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-math.rad(larmrand)/8) * CFrame.new(0,-0.5,0),0.1)
- vrightarm.C0 = vrightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,math.rad(rarmrand)/8) * CFrame.new(0,-0.5,0),0.1)
- vleftleg.C0 = vleftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(0,0,-math.rad(llegrand)/2) * CFrame.new(0,-1,0),0.1)
- vrightleg.C0 = vrightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.Angles(0,0,math.rad(rlegrand)/2) * CFrame.new(0,-1,0),0.1)
- elseif vanim == "walk" then
- vhumanoidrootpart.C0 = vhumanoidrootpart.C0:lerp(CFrame.new(0,-2.5,0) * CFrame.Angles(-math.pi/2,0,math.cos(tick()*7)/10),0.1)
- vhead.C0 = vhead.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.1)
- vleftarm.C0 = vleftarm.C0:lerp(CFrame.new(-1.5,0.5+math.sin(tick()*7)/5,0) * CFrame.Angles(0,0,-math.rad(larmrand)/8+math.cos(tick()*7)/4) * CFrame.new(0,-0.5,0),0.1)
- vrightarm.C0 = vrightarm.C0:lerp(CFrame.new(1.5,0.5-math.sin(tick()*7)/5,0) * CFrame.Angles(0,0,math.rad(rarmrand)/8-math.cos(tick()*7)/4) * CFrame.new(0,-0.5,0),0.1)
- vleftleg.C0 = vleftleg.C0:lerp(CFrame.new(-0.5,-1-math.sin(tick()*7)/5,0) * CFrame.Angles(0,0,-math.rad(llegrand)/2) * CFrame.new(0,-1,0),0.1)
- vrightleg.C0 = vrightleg.C0:lerp(CFrame.new(0.5,-1+math.sin(tick()*7)/5,0) * CFrame.Angles(0,0,math.rad(rlegrand)/2) * CFrame.new(0,-1,0),0.1)
- end
- elseif dyinganim == 3 then
- if vanim == "idle" then
- vhumanoidrootpart.C0 = vhumanoidrootpart.C0:lerp(CFrame.new(0,-2,0) * CFrame.Angles(-math.pi/2,0,rootpart.RotVelocity.y/50),0.1)
- vhead.C0 = vhead.C0:lerp(CFrame.new(0,1.5,0),0.1)
- vleftarm.C0 = vleftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi/2+math.rad(40),0,-math.rad(larmrand)/8) * CFrame.new(0,-0.5,0),0.1)
- vrightarm.C0 = vrightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2+math.rad(40),0,math.rad(rarmrand)/8) * CFrame.new(0,-0.5,0),0.1)
- vleftleg.C0 = vleftleg.C0:lerp(CFrame.new(-0.5,-1,-0.5) * CFrame.Angles(0,0,-math.rad(llegrand)/2) * CFrame.new(0,-1,0),0.1)
- vrightleg.C0 = vrightleg.C0:lerp(CFrame.new(0.5,-1,-0.5) * CFrame.Angles(0,0,math.rad(rlegrand)/2) * CFrame.new(0,-1,0),0.1)
- elseif vanim == "walk" then
- vhumanoidrootpart.C0 = vhumanoidrootpart.C0:lerp(CFrame.new(0,-2,0) * CFrame.Angles(-math.pi/2,0,math.cos(tick()*5)/10),0.1)
- vhead.C0 = vhead.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.1)
- vleftarm.C0 = vleftarm.C0:lerp(CFrame.new(-1.5,0.5+math.sin(tick()*5)/3,0) * CFrame.Angles(math.pi/2+math.rad(40)+math.sin(tick()*5)/2,0,-math.rad(larmrand)/8+math.cos(tick()*5)/4) * CFrame.new(0,-0.5,0),0.1)
- vrightarm.C0 = vrightarm.C0:lerp(CFrame.new(1.5,0.5-math.sin(tick()*5)/3,0) * CFrame.Angles(math.pi/2+math.rad(40)-math.sin(tick()*5)/2,0,math.rad(rarmrand)/8-math.cos(tick()*5)/4) * CFrame.new(0,-0.5,0),0.1)
- vleftleg.C0 = vleftleg.C0:lerp(CFrame.new(-0.5,-1-math.sin(tick()*5)/3,-0.5) * CFrame.Angles(0,0,-math.rad(llegrand)/2) * CFrame.new(0,-1,0),0.1)
- vrightleg.C0 = vrightleg.C0:lerp(CFrame.new(0.5,-1+math.sin(tick()*5)/3,-0.5) * CFrame.Angles(0,0,math.rad(rlegrand)/2) * CFrame.new(0,-1,0),0.1)
- end
- end
- end
- end)()
- end)()
- end
- end
- else
- --print("death")
- hum.Parent.Archivable = true
- hum.PlatformStand = true
- ragdollplr(hum.Parent)
- local vclone = hum.Parent:Clone()
- for q,w in pairs(hum.Parent:GetDescendants()) do
- if w.ClassName == "Part" or w.ClassName == "MeshPart" then
- w:destroy()
- end
- end
- for q,w in pairs(vclone:GetDescendants()) do
- if w.ClassName == "Sound" then
- w:destroy()
- end
- if w.ClassName == "BodyPosition" or w.ClassName == "BodyVelocity" or w.ClassName == "Weld" then
- if w.Name ~= "LimbCollider" and w.Name ~= "LimbWeld" then
- w:destroy()
- end
- end
- if w.ClassName == "Script" then
- w.Disabled = true
- end
- end
- vclone.Parent = workspace
- vclone:findFirstChildOfClass("Humanoid").Health = 0
- vclone:findFirstChildOfClass("Humanoid").PlatformStand = true
- coroutine.wrap(function()
- wait()
- if vclone:findFirstChild("HumanoidRootPart") then
- vclone:findFirstChild("HumanoidRootPart"):destroy()
- end
- end)()
- game.Debris:AddItem(vclone, 30)
- end
- end
- else
- hum.Health = hum.Health - damage
- ragdollplr(what.Parent)
- end
- end
- else
- bullet:Destroy()
- end
- end
- end
- end)
- end
- coroutine.wrap(function()
- for i = 1,5 do
- tiltvalue = tiltvalue + 2.5
- runservice.Stepped:wait()
- end
- end)()
- for i = 0,1 , 0.08 do
- rootpart.CFrame = rootpart.CFrame * CFrame.new(0,0,0.1)
- weldshotgun.C0 = weldshotgun.C0:lerp(CFrame.new(0,-1,-0.35) * CFrame.Angles(-math.pi/2,0,0),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.21384871, 0.500000477, -0.879925251, 0.342019856, 0.939692438, -1.49501886e-08, 1.94707184e-07, -2.68220873e-07, -0.999999821, -0.939692438, 0.342020035, -3.76157232e-07) * CFrame.new(0,0.3,0),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.59201181, 0.470158577, -0.794548988, 0.271118939, 0.181368172, 0.945304275, 0.902039766, -0.390578717, -0.18377316, 0.335885108, 0.902526498, -0.269494623) * CFrame.new(0.1,0,0.8),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,(-math.pi/2)+math.rad(20),0), i)
- runservice.Stepped:wait()
- end
- coroutine.wrap(function()
- for i = 1,5 do
- tiltvalue = tiltvalue - 2.5
- runservice.Stepped:wait()
- end
- tiltvalue = 0
- end)()
- humanoid.WalkSpeed = 20
- cananimate = true
- canattack = true
- elseif what == "well hello there" and canattack then
- canattack = false
- cananimate = false
- local gottem = false
- for i,v in pairs(workspace:GetDescendants()) do
- if v.ClassName == "Model" then
- local vhum = v:findFirstChildOfClass("Humanoid")
- local vhead = v:findFirstChild("Head")
- if vhum and vhead then
- if vhum.Health > 0 then
- if v:findFirstChild("dying") then
- if (vhead.Position - rootpart.Position).magnitude < 12 then
- if not gottem then
- gottem = true
- local uhoh = Instance.new("Sound", character.Head)
- uhoh.SoundId = "rbxassetid://4458464514"
- uhoh.Volume = 2
- uhoh.PlayOnRemove = true
- uhoh:destroy()
- for i = 0,1 , 0.01 do
- weldshotgun.C0 = weldshotgun.C0:lerp(CFrame.new(0,-1,-0.35) * CFrame.Angles(-math.pi/2,0,0),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles((math.pi/2)-math.rad(40),0,math.rad(50)) * CFrame.new(0,-0.5,0),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-math.rad(30)) * CFrame.new(0,-0.5,0),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,(math.pi/2),0), i)
- rootpart.CFrame = rootpart.CFrame:lerp(CFrame.new(rootpart.Position, Vector3.new(vhead.Position.x,rootpart.Position.y,vhead.Position.z)) * CFrame.Angles(0,math.rad(-30),0),i)
- runservice.Stepped:wait()
- end
- local light = Instance.new("PointLight", shotgun)
- game.Debris:AddItem(light,0.1)
- vhum.Health = 0.005
- shootsound:Play()
- for i = 0,1 , 0.09 do
- vhum.WalkSpeed = 0
- weldshotgun.C0 = weldshotgun.C0:lerp(CFrame.new(0,-1,-0.35) * CFrame.Angles(-math.pi/2,0,0),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1,0.7,0.5) * CFrame.Angles((math.pi/2)-math.rad(50),0,math.rad(70)) * CFrame.new(0,-0.5,0),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-math.rad(30)) * CFrame.new(0,-0.5,0),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(math.rad(5),(math.pi/2)-math.rad(35),0), i)
- rootpart.CFrame = rootpart.CFrame * CFrame.new(0,0,0.05)
- runservice.Stepped:wait()
- end
- end
- end
- end
- end
- end
- end
- end
- cananimate = true
- canattack = true
- end
- end
- end)
- while runservice.Stepped:wait() do
- if cananimate then
- if anim == "run" then
- weldshotgun.C0 = weldshotgun.C0:lerp(CFrame.new(0,-0.5,-0.25) * CFrame.Angles(-math.pi/2,0,0),0.3)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.sin(tick()*24)/15,0) * CFrame.Angles(0,math.rad(-rootpart.Orientation.y),0) * CFrame.fromEulerAnglesXYZ(humanoid.MoveDirection.z/3,0,-humanoid.MoveDirection.x/3) * CFrame.Angles(0,math.rad(rootpart.Orientation.y),0) * CFrame.Angles(0,0,math.cos(tick()*12)/15),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.3,0,-0.65) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*12)/5+math.rad(50),0,math.rad(30)) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1,0.25,-0.5) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*12)/5+math.rad(50),0,math.rad(-50)) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*12)/4,-math.cos(tick()*12)/2.5) * CFrame.Angles(0,math.rad(-rootpart.Orientation.y),0) * CFrame.fromEulerAnglesXYZ((-math.sin(tick()*12)*humanoid.MoveDirection.z)*1.1,0,(-math.sin(tick()*12)*-humanoid.MoveDirection.x)*1.1) * CFrame.Angles(0,math.rad(rootpart.Orientation.y),0) * CFrame.new(0,-1,0),0.3)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*12)/4,math.cos(tick()*12)/2.5) * CFrame.Angles(0,math.rad(-rootpart.Orientation.y),0) * CFrame.fromEulerAnglesXYZ((math.sin(tick()*12)*humanoid.MoveDirection.z)*1.1,0,(math.sin(tick()*12)*-humanoid.MoveDirection.x)*1.1) * CFrame.Angles(0,math.rad(rootpart.Orientation.y),0) * CFrame.new(0,-1,0),0.3)
- elseif anim == "idle" then
- weldshotgun.C0 = weldshotgun.C0:lerp(CFrame.new(0,-0.5,-0.25) * CFrame.Angles(-math.pi/2,0,0),0.3)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.sin(tick())/20,0) * CFrame.Angles(0,math.rad(20),math.sin(tick()/2)/30),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.3,0.1,-0.65) * CFrame.fromEulerAnglesXYZ(math.sin(tick())/5+math.rad(70),0,math.rad(30)) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1,0.25,-0.5) * CFrame.fromEulerAnglesXYZ(math.sin(tick())/5+math.rad(70),0,math.rad(-50)) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.sin(tick())/20,0) * CFrame.Angles(0,0,math.rad(-3)-math.sin(tick()/2)/30) * CFrame.new(0,-1,0),0.3)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.sin(tick())/20,0) * CFrame.Angles(0,0,math.rad(3)-math.sin(tick()/2)/30) * CFrame.new(0,-1,0),0.3)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement