Hello, a friend gave me a terminal to use for a fort that I am working on. It works great, however, I do have one issue with it.

Whenever someone dies, the terminal will be unable to be captured until their body has completely despawned. What's the best way to fix this issue?

		for i, obj in pairs(objects) do
			if obj.Parent:FindFirstChild("Humanoid") then
				local player = game.Players:GetPlayerFromCharacter(obj.Parent)
				if player.TeamColor == hostiles_color and valid == true then
					if Progress.Value < 1 then
						Progress.Value = Progress.Value + 0.0003
					end
				elseif player.TeamColor == defenders_color and valid == true then
					if Progress.Value > 0 then
						Progress.Value = Progress.Value - 0.0003
					end
				elseif config.AlliesCaptureAsDefenders.Value == true and player.TeamColor == allies_color and valid == true then
					if Progress.Value > 0 then
						Progress.Value = Progress.Value - 0.0003
					end
				end
			end
		end
	end
end)

1 comment

1

Why not check if their humanoid health is 0?