I’m trying to add a custom morph to my Piggy fangame, but the kill script won’t work. On every morph the kill script works fine. In this morph, it’ll either
Kill yourself, or kill only 1 person.
Kill script:
local animKill = script.Parent.Parent:FindFirstChild("Humanoid"):LoadAnimation(script.Parent.Parent.Swing)
local bs = game:GetService("BadgeService")
local id = 3087677870210396
debounce = false
Dummy.Hitbox.Touched:Connect(function(IsAPlayer)
print("Someone touched remote")
if debounce == false then
if game.Players:FindFirstChild(IsAPlayer.Parent.Name) then
local player = game.Players:GetPlayerFromCharacter(IsAPlayer.Parent)
if IsAPlayer.Parent.Name == Dummy.Name then
print("trying to oof myself..")
else
animKill:Play()
--bs:AwardBadge(player.UserId, id)
debounce = true
game.ReplicatedStorage.TIOAttackCamera:FireClient(player, Dummy.Camera)
local InJumpscare = Instance.new("BoolValue", IsAPlayer)
InJumpscare.Name = "InJumpscare"
IsAPlayer.Parent.HumanoidRootPart.Anchored = true
Dummy.HumanoidRootPart.Ambience.Playing = false
task.wait(0.25)
Dummy.HumanoidRootPart.Anchored = true
animKill:GetMarkerReachedSignal("Hit"):Connect(function()
Dummy.ShovelHit:Play()
end)
animKill:GetMarkerReachedSignal("Scream"):Connect(function()
Dummy.Scream:Play()
task.wait(0.5)
if IsAPlayer then
IsAPlayer.Parent.HumanoidRootPart.Anchored = false
IsAPlayer.Parent.Humanoid.Health = 0
end
task.wait(1)
Dummy.HumanoidRootPart.Ambience.Playing = true
Dummy.HumanoidRootPart.Anchored = false
end)
debounce = false
end
end
end
end)