Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sound = Instance.new("Sound")
- sound.PlayOnRemove = true
- local part = Instance.new("Part",owner.Character)
- local msh = Instance.new("SpecialMesh", part)
- msh.MeshId = "rbxassetid://9032989020"
- msh.TextureId = "rbxassetid://9032989352"
- msh.Scale = Vector3.new(0.125,0.125,0.125)
- part.CanCollide = false
- owner.Character.Humanoid.WalkSpeed = 14
- local s = Instance.new("Sound",owner.Character.Head)
- s.Volume = 1
- s.SoundId = "rbxassetid://8238598284"
- s.Looped = true
- NLS([[
- s = script.Parent.Head:FindFirstChildWhichIsA("Sound")
- mouse = owner:GetMouse()
- mouse.KeyDown:Connect(function(key)
- key = key:lower()
- if key:byte() == 48 then
- for i = 1,14 do
- task.wait()
- owner.Character.Humanoid.WalkSpeed = math.clamp(owner.Character.Humanoid.WalkSpeed + 1,14,28)
- s.Pitch = math.clamp(s.Pitch + 0.07142857142,1,2)
- end
- end
- end)
- mouse.KeyUp:Connect(function(key)
- key = key:lower()
- if key:byte() == 48 then
- for i = 1,14 do
- task.wait()
- owner.Character.Humanoid.WalkSpeed = math.clamp(owner.Character.Humanoid.WalkSpeed - 1,14,28)
- s.Pitch = math.clamp(s.Pitch - 0.07142857142,1,2)
- end
- end
- end)
- local db = false
- game:GetService("RunService").RenderStepped:Connect(function()
- if owner.Character.Humanoid.MoveDirection ~= Vector3.new(0,0,0) and owner.Character.Humanoid.FloorMaterial ~= Enum.Material.Air then
- if not db then
- db = true
- s:Resume()
- end
- else
- s:Pause()
- db = false
- end
- end)
- ]],owner.Character)
- part.Size = Vector3.new(1.82233333333, 2.06408333333, 0.68208333333)
- part.Massless = true
- local w = Instance.new("Weld", owner.Character)
- w.Part0 = part
- w.Part1 = owner.Character.Torso
- w.C1 = CFrame.new(0, 0, 1)
- sound.Volume = 1
- sound.SoundId = "rbxassetid://4458750270"
- local heal = "rbxassetid://7380846790"
- local equip = "rbxassetid://4458750270"
- tool = Instance.new("Tool",owner.Backpack)
- tool.Grip = CFrame.new(0.125,0.75,1.75) * CFrame.Angles(math.rad(11),math.rad(10),math.rad(-21)) * CFrame.Angles(math.rad(-14),0,0)
- tool.Name = "Medigun"
- local medigun = Instance.new("Part", tool)
- medigun.Name = "Handle"
- medigun.Size = Vector3.new(1.2815, 1.9999, 3.5064)
- local medigun2 = Instance.new("Part", owner.Character)
- medigun2.CanCollide = false
- medigun2.Massless = true
- medigun2.Size = Vector3.new(1.2815, 1.9999, 3.5064)
- local w2 = Instance.new("Weld", owner.Character)
- w2.Part0 = medigun2
- w2.Part1 = owner.Character.Torso
- w2.C1 = CFrame.new(1.25, 0, 0.8) * CFrame.Angles(math.rad(-11),math.rad(-10),math.rad(-7)) * CFrame.Angles(math.rad(90),0,0)
- w2.C0 = CFrame.Angles(math.rad(18),math.rad(-5),math.rad(90))
- local msh = Instance.new("SpecialMesh", medigun2)
- msh.MeshId = "rbxassetid://9029971538"
- msh.TextureId = "rbxassetid://9021800315"
- msh.Scale = Vector3.new(0.125, 0.125, 0.125)
- local attachment0 = Instance.new("Attachment",medigun)
- local attachment1 = Instance.new("Attachment",part)
- local alignposition = Instance.new("RopeConstraint",part)
- alignposition.Attachment0 = attachment0
- alignposition.Attachment1 = attachment1
- alignposition.Visible = true
- alignposition.Length = 3
- alignposition.Thickness = 0.35
- alignposition.Restitution = 0
- alignposition.Color = BrickColor.new("Black")
- attachment0.CFrame = CFrame.new(0.05,0,2)
- attachment1.CFrame = CFrame.new(0.65,-0.75,0.125)
- local attachment0 = Instance.new("Attachment",medigun2)
- local attachment1 = Instance.new("Attachment",part)
- local alignposition = Instance.new("RopeConstraint",part)
- alignposition.Attachment0 = attachment0
- alignposition.Attachment1 = attachment1
- alignposition.Visible = true
- alignposition.Length = 3
- alignposition.Thickness = 0.35
- alignposition.Restitution = 0
- alignposition.Color = BrickColor.new("Black")
- attachment0.CFrame = CFrame.new(0.05,-0.125,2)
- attachment1.CFrame = CFrame.new(0.65,-0.65,0.125)
- local muzzle = Instance.new("Part",medigun)
- muzzle.Transparency = 1
- muzzle.CanCollide = false
- muzzle.Size = Vector3.new(0.1,0.1,0.1)
- local wel = Instance.new("Weld",medigun)
- wel.Part0 = muzzle
- wel.Part1 = medigun
- wel.C0 = CFrame.Angles(math.rad(-11),math.rad(-10),math.rad(21)) * CFrame.new(0.3,-0.725,2)
- local msh = Instance.new("SpecialMesh", medigun)
- msh.MeshId = "rbxassetid://9029971538"
- msh.TextureId = "rbxassetid://9021800315"
- msh.Scale = Vector3.new(0.125, 0.125, 0.125)
- local weld = Instance.new("Weld",owner.Character.Torso)
- weld.Part0 = owner.Character["Right Arm"]
- weld.Part1 = owner.Character.Torso
- weld.C1 = CFrame.new(1.5,0.75,-0.25) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25))
- local weld2 = Instance.new("Weld",owner.Character.Torso)
- weld2.Part0 = owner.Character["Left Arm"]
- weld2.Part1 = owner.Character.Torso
- weld2.C1 = CFrame.new(-0.125,-0.5,-2) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40))
- weld2.Enabled = false
- weld.Enabled = false
- local tweenfinished = false
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(0.5,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
- local tweenInfo2 = TweenInfo.new(0.65,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
- local goal = {}
- goal.C1 = CFrame.new(-0.125,-0.5,-2) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40))
- local tween = tweenService:Create(weld2, tweenInfo, goal)
- local goal2 = {}
- goal2.C1 = CFrame.new(1.5,0.75,-0.25) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25))
- local tween2 = tweenService:Create(weld, tweenInfo2, goal2)
- tool.AncestryChanged:Connect(function(_, who)
- if who == owner.Character then
- alignposition.Visible = false
- medigun2.Transparency = 1
- medigun.Transparency = 0
- weld.Enabled = true
- weld2.Enabled = true
- sound.Volume = 0.5
- sound.SoundId = equip
- sound.Parent = medigun
- sound.Parent = nil
- tween:Play()
- tween2:Play()
- tween2.Completed:Wait()
- tweenfinished = true
- else
- medigun.Transparency = 1
- alignposition.Visible = true
- medigun2.Transparency = 0
- weld.Enabled = false
- weld2.Enabled = false
- weld.C1 = CFrame.new(1.5,-0.75,-0.25) * CFrame.Angles(math.rad(186),math.rad(-10),math.rad(-25))
- weld2.C1 = CFrame.new(-0.125,0.5,0) * CFrame.Angles(math.rad(150),math.rad(20),math.rad(40))
- tween2:Cancel()
- tween:Cancel()
- tweenfinished = false
- end
- end)
- local attachment0 = Instance.new("Attachment")
- attachment0.Parent = muzzle
- local attachment1 = Instance.new("Attachment")
- attachment1.Parent = medigun
- local beam = Instance.new("Beam",medigun)
- beam.Attachment0 = attachment0
- beam.Attachment1 = attachment1
- beam.CurveSize0 = 0.5
- beam.CurveSize1 = 1.5
- beam.FaceCamera = true
- beam.Segments = 10
- beam.Width0 = 1
- beam.Width1 = 0.75
- beam.Texture = "rbxassetid://175588117"
- beam.TextureLength = 1
- beam.LightEmission = 1
- beam.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0, 0.125),NumberSequenceKeypoint.new(1, 0.5)}
- beam.Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(227, 34, 34)),ColorSequenceKeypoint.new(1, Color3.fromRGB(250, 30, 30))}
- beam.Enabled = false
- local active = false
- local pe = Instance.new("ParticleEmitter",muzzle)
- pe.Color = ColorSequence.new(Color3.fromRGB(255, 74, 29))
- pe.LightEmission = 0.75
- pe.Size = NumberSequence.new{NumberSequenceKeypoint.new(0,1.25),NumberSequenceKeypoint.new(0.5,1),NumberSequenceKeypoint.new(1,0.7)}
- pe.Texture = "rbxassetid://9345352897"
- pe.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0,0.4),NumberSequenceKeypoint.new(0.5,0.25),NumberSequenceKeypoint.new(1,1)}
- pe.Lifetime = NumberRange.new(0.4,0.7)
- pe.Rate = 50
- pe.LockedToPart = true
- pe.Rotation = NumberRange.new(0,360)
- pe.RotSpeed = NumberRange.new(1000)
- pe.Speed = NumberRange.new(1.5,3)
- pe.EmissionDirection = "Front"
- pe.Enabled = false
- local model = nil
- local function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 20
- local temp = nil
- local human = nil
- local temp2 = nil
- local LastAngle = 80
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= model) and temp2 ~= owner.Character then
- temp = temp2:findFirstChild("Head")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- local Angle = math.deg(math.acos(owner.Character.Head.CFrame.lookVector:Dot((temp.Position - pos).Unit)))
- if Angle <= LastAngle then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- LastAngle = Angle
- end
- end
- end
- end
- end
- return torso
- end
- local whoheal = nil
- tool.Activated:Connect(function()
- if tweenfinished then
- local torso = findNearestTorso(medigun.Position)
- if torso~=nil then
- active = true
- whoheal = torso:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid")
- pe.Enabled = true
- beam.Enabled = true
- attachment1.Parent = torso
- sound.Volume = 0.5
- sound.SoundId = heal
- sound.Parent = medigun
- sound.Parent = nil
- end
- end
- end)
- tool.Deactivated:Connect(function()
- active = false
- pe.Enabled = false
- beam.Enabled = false
- attachment1.Parent = medigun
- whoheal = nil
- end)
- function whatpitch(letter)
- if letter == "a" then return 1.2 end
- if letter == "b" then return 0.9 end
- if letter == "c" then return 1 end
- if letter == "d" then return 0.8 end
- if letter == "e" then return 1.1 end
- if letter == "f" then return 0.9 end
- if letter == "g" then return 1 end
- if letter == "h" then return 0.9 end
- if letter == "i" then return 1.2 end
- if letter == "j" then return 1 end
- if letter == "k" then return 1.3 end
- if letter == "l" then return 1 end
- if letter == "m" then return 0.8 end
- if letter == "n" then return 0.7 end
- if letter == "o" then return 0.8 end
- if letter == "p" then return 1 end
- if letter == "q" then return 1.2 end
- if letter == "r" then return 0.9 end
- if letter == "s" then return 1 end
- if letter == "t" then return 1.2 end
- if letter == "u" then return 1 end
- if letter == "v" then return 0.9 end
- if letter == "w" then return 1 end
- if letter == "x" then return 0.8 end
- if letter == "y" then return 0.9 end
- if letter == "z" then return 1.1 end
- end
- clik = Instance.new("Sound")
- clik.Volume = 1
- clik.SoundId = "rbxassetid://7903113688"
- clik.PlayOnRemove = true
- owner.Chatted:Connect(function(msg)
- if msg:sub(1,3) ~= "/e " then
- local billboard = Instance.new("BillboardGui", owner.Character.Head)
- billboard.Adornee = owner.Character.Head
- billboard.Size = UDim2.new(3,0,1.5,0)
- billboard.StudsOffset = Vector3.new(-3, 2.5, 0)
- local tb = Instance.new("TextBox", billboard)
- tb.BackgroundTransparency = 1
- tb.TextStrokeTransparency = 0
- tb.TextColor3 = Color3.new(209/255, 42/255, 42/255)
- tb.TextSize = 25
- tb.Font = "PatrickHand"
- tb.MultiLine = true
- tb.Text = " "
- tb.TextWrapped = true
- tb.TextScaled = true
- tb.Size = billboard.Size
- for i = 1, #msg do
- tb.Text = string.sub(msg,1,i)
- if msg:sub(i,i) ~= " " then
- if (msg:sub(i,i) == msg:sub(i,i):lower()) then
- local p = whatpitch(msg:sub(i,i))
- clik.Pitch = p
- else
- local p = whatpitch(msg:sub(i,i))
- pcall(function()
- clik.Pitch = (p - 0.2)
- end)
- end
- wait(0.125)
- clik.Parent = owner.Character.Head
- clik.Parent = nil
- end
- end
- tb.Text = msg
- game:GetService("Debris"):AddItem(billboard,5)
- end
- end)
- local hitrecent = false
- local lasthealth = owner.Character.Humanoid.Health
- owner.Character.Humanoid.HealthChanged:Connect(function(new)
- if new < lasthealth then
- hitrecent = true
- local recenthealth = new
- delay(2,function()
- if recenthealth <= lasthealth then
- print("good")
- hitrecent = false
- end
- end)
- lasthealth = new
- end
- end)
- while task.wait() do
- if active and tweenfinished then
- local rand = (Random.new():NextNumber(-0.01875,0.01875)*math.sin(45*tick()))
- local rand2 = (Random.new():NextNumber(-0.01875,0.01875)*math.sin(45*tick()))
- local rand3 = (Random.new():NextNumber(-0.01875,0.01875)*math.sin(45*tick()))
- weld2.C1 = CFrame.new(-0.125 + rand,-0.5 + rand2,-2 + rand3) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40)) * CFrame.Angles(math.rad(rand2 * 3),math.rad(rand * 3),math.rad(rand3 * 3))
- weld.C1 = CFrame.new(1.5 + rand,0.75 + rand2,-0.25 + rand3) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25)) * CFrame.Angles(math.rad(rand2 * 3),math.rad(rand * 3),math.rad(rand3 * 3))
- wait(0.025)
- elseif not active and tweenfinished then
- weld.C1 = CFrame.new(1.5,0.75,-0.25) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25))
- weld2.C1 = CFrame.new(-0.125,-0.5,-2) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40))
- end
- if whoheal ~= nil and (medigun.Position - whoheal.Parent:FindFirstChildWhichIsA("Part").Position).Magnitude <= 35 then
- whoheal.Health += 0.85
- elseif whoheal ~= nil and (medigun.Position - whoheal.Parent:FindFirstChildWhichIsA("Part").Position).Magnitude > 35 then
- whoheal = nil
- pe.Enabled = false
- beam.Enabled = false
- active = false
- end
- if not hitrecent then
- owner.Character.Humanoid.Health += 0.25
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement