-
What do you want to achieve? Keep it simple and clear!
On my script Heartbeat is not running despite prints showing up in the output before. I even added prints inside of the Heartbeat, but they do not show up. -
What is the issue? Include screenshots / videos if possible!
The Heartbeat doesn’t work after 2 times the flag is picked up.
https://gyazo.com/0014bf7e12bbeffbc9e32c96094fe845 - The code shown here -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried searching, I tried using Humanoid.Died (that didn’t work either), I asked my other developer friends but they couldn’t figure out either. So now I am here.
The Humanoid is gained from Hit.Parent, and then finding Humanoid in it.
No errors show up in the script at all, what am I doing wrong here?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Code here:
if Humanoid and Humanoid.Health > 0 and Player and Player:IsA("Player") and (Player.Team ~= TEAM.Value or Player.Neutral and TEAM.Value ~= nil and TEAM.Value:IsA("Team")) then
print("enemy team picked up")
local CarryTag = Instance.new("BoolValue", Part.Parent)
CarryTag.Name = "CarryingOpponentFlag"
CarryTag.Value = true
HeartbeatMaid.OnDeath = game:GetService("RunService").Heartbeat:Connect(function()
print(Humanoid.Health)
if Humanoid.Health <= 0 or not Humanoid.Parent:FindFirstChild("CarryingOpponentFlag") then
print("Target died")
HeartbeatMaid:DoCleaning()
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.