CoreGUI Damage Problem

Hello! Recently I’ve been working on a fighting game of mine, and I noticed that when a player takes more than 5 damage via the :TakeDamage() function, their screen flashes a red vignette, and I want to disable it.

The only thing I got from the DevForum so far was disabling the entirety of the health CoreGUI, but that also disables the default Roblox health bar, and I don’t want that. Now before you say that it isn’t possible, I know it is because I’ve seen games like The Strongest Battlegrounds do it before.

They most likely disabled the health CoreGUI and made a custom UI for the health bar which isn’t too hard.

Just a few minutes after the topbar gui was updated a few months ago, the health bar in The Strongest Battlegrounds had already shifted to its new position. I highly doubt they updated it that fast, so they must be using the default one. Plus, it looks identical to the default one.

Havent tested, but maybe doing
Humanoid.Health -= damage instead of Humanoid:TakeDamage(damage) could work

It’s not too difficult to exactly replicate the healthbar and move it. I believe TopbarPlus by ForeverHD accomplished this, so you could take that module and take a look.

TopbarPlus’ healthbar automatically does that. Not sure what’s so special.

At the time I mentioned, the TopbarPlus icons had not yet been updated, only the health bar. I’m curious though, what do you mean by TopbarPlus healthbar? It’s not in the api.

I can’t find it in the current release (version 3) of TopbarPlus but I know for a fact I saw it in earlier releases. See if you can find the code there.

Found it!

function IconController.setupHealthbar()

	if createdFakeHealthbarIcon then
	createdFakeHealthbarIcon = true

	-- Create a fake healthbar icon to mimic the core health gui
		local Icon = require(iconModule)
			:setProperty("internalIcon", true)
			:setSize(80, 32)
			:set("iconBackgroundTransparency", 1)

				local healthContainer ="Frame")
				healthContainer.Name = "HealthContainer"
				healthContainer.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
				healthContainer.BorderSizePixel = 0
				healthContainer.AnchorPoint =, 0.5)
				healthContainer.Position =, 0, 0.5, 0)
				healthContainer.Size =, 0, 0.2, 0)
				healthContainer.Visible = true
				healthContainer.ZIndex = 11
				healthContainer.Parent = icon.instances.iconButton

				local corner ="UICorner")
				corner.CornerRadius =, 0)
				corner.Parent = healthContainer

				local healthFrame = healthContainer:Clone()
				healthFrame.Name = "HealthFrame"
				healthFrame.BackgroundColor3 = Color3.fromRGB(167, 167, 167)
				healthFrame.BorderSizePixel = 0
				healthFrame.AnchorPoint =, 0.5)
				healthFrame.Position =, 0, 0.5, 0)
				healthFrame.Size =, -2, 1, -2)
				healthFrame.Visible = true
				healthFrame.ZIndex = 12
				healthFrame.Parent = healthContainer

				local healthBar = healthFrame:Clone()
				healthBar.Name = "HealthBar"
				healthBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
				healthBar.BorderSizePixel = 0
				healthBar.AnchorPoint =, 0.5)
				healthBar.Position =, 0, 0.5, 0)
				healthBar.Size =, 0, 1, 0)
				healthBar.Visible = true
				healthBar.ZIndex = 13
				healthBar.Parent = healthFrame

				local START_HEALTHBAR_COLOR = Color3.fromRGB(27, 252, 107)
				local MID_HEALTHBAR_COLOR = Color3.fromRGB(250, 235, 0)
				local END_HEALTHBAR_COLOR = Color3.fromRGB(255, 28, 0)

				local function powColor3(color, pow)
						math.pow(color.R, pow),
						math.pow(color.G, pow),
						math.pow(color.B, pow)

				local function lerpColor(colorA, colorB, frac, gamma)
					gamma = gamma or 2.0
					local CA = powColor3(colorA, gamma)
					local CB = powColor3(colorB, gamma)
					return powColor3(CA:Lerp(CB, frac), 1/gamma)

				local firstTimeEnabling = true
				local function listenToHealth(character)
					if not character then
					local humanoid = character:WaitForChild("Humanoid", 10)
					if not humanoid then

					local function updateHealthBar()
						local realHealthbarEnabled = starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)
						local healthInterval = humanoid.Health / humanoid.MaxHealth
						if healthInterval == 1 or IconController.healthbarDisabled or (firstTimeEnabling and realHealthbarEnabled == false) then
							if icon.enabled then
						elseif healthInterval < 1 then
							if not icon.enabled then
							firstTimeEnabling = false
							if realHealthbarEnabled then
								starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
						local startInterval = 0.9
						local endInterval = 0.1
						local m = 1/(startInterval - endInterval)
						local c = -m*endInterval
						local colorIntervalAbsolute = (m*healthInterval) + c
						local colorInterval = (colorIntervalAbsolute > 1 and 1) or (colorIntervalAbsolute < 0 and 0) or colorIntervalAbsolute
						local firstColor = (healthInterval > 0.5 and START_HEALTHBAR_COLOR) or MID_HEALTHBAR_COLOR
						local lastColor = (healthInterval > 0.5 and MID_HEALTHBAR_COLOR) or END_HEALTHBAR_COLOR
						local doubleSubtractor = (1-colorInterval)*2
						local modifiedColorInterval = (healthInterval > 0.5 and (1-doubleSubtractor)) or (2-doubleSubtractor)
						local newHealthFillColor = lerpColor(lastColor, firstColor, modifiedColorInterval)
						local newHealthFillSize =, 0, 1, 0)
						healthBar.BackgroundColor3 = newHealthFillColor
						healthBar.Size = newHealthFillSize

				task.spawn(listenToHealth, localPlayer.Character)

If you want to create this for yourself you probably don’t need the Icon module and could just create this in studio with no problem. Just copy the properties and setup the connections yourself


I’ll try that when I get home.

I managed to get it working after a bit of adapting to Topbar 3.0, thanks!

1 Like