Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pl = game:service'Players'.LocalPlayer
- local chara = pl.Character
- local hum = chara:FindFirstChildOfClass("Humanoid")
- hum.MaxHealth = 1000
- hum.Health = 1000
- maincol = "White"
- increment = 20
- if pl.Name == "TheObsidionCat" then
- maincol = "Really black"
- end
- script.Parent = pl
- ArtificialHB = Instance.new("BindableEvent", script)
- ArtificialHB.Name = "Heartbeat"
- script:WaitForChild("Heartbeat")
- frame = 0.03333333333333
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- script.Heartbeat:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.Heartbeat:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- script.Heartbeat:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function swait(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num do
- ArtificialHB.Event:wait()
- end
- end
- end
- prevhp = 1000
- function gethurt(hp)
- if hp < prevhp then
- local s = Instance.new("Sound",chara)
- s.SoundId = "rbxassetid://509138786"
- s.Pitch = 1
- s.Volume = 1
- s.PlayOnRemove = true
- s:Destroy()
- for _, v in pairs(chara:children()) do
- if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
- do
- local p = v:clone()
- p.Name = "trail"
- p.Parent = workspace
- p.Transparency = 0.5
- p.Anchored = true
- p.BrickColor = BrickColor.new(maincol)
- p.Material = "Neon"
- p:BreakJoints()
- p.CanCollide = false
- if v == chara.Head then
- for a, b in pairs(p:children()) do
- if b:IsA("Sound") then
- b:Destroy()
- end
- end
- end
- coroutine.resume(coroutine.create(function()
- for i = 1, 50 do
- swait()
- p.Transparency = i / 50
- end
- p:Destroy()
- end))
- end
- end
- if v.className == "Accessory" then
- end
- end
- end
- chara.HumanoidRootPart.CFrame = chara.HumanoidRootPart.CFrame + Vector3.new(math.random(-increment,increment),0,math.random(-increment,increment))
- hum.MaxHealth = 1000
- hum.Health = 1000
- prevhp = 1000
- end
- hum.HealthChanged:connect(gethurt)
- pl.CharacterAdded:connect(function()
- chara = pl.Character
- hum = chara:FindFirstChildOfClass("Humanoid")
- hum.MaxHealth = 1000
- hum.Health = 1000
- hum.HealthChanged:connect(gethurt)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement