My goal is to fix the health bar. The code isn’t wrong I believe but the photos aren’t working. Is it just a ROBLOX issue?
The issue is: I cannot see image change when taking damage
And yes. I did try fixing it even using Roblox assistant, nothing works. For example: It’s a break in fangame so your image changes depending on health.
Tried solutions yet didn’t work, dunno.
Heres the code and where the script is placed:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local healthChangedConnection
local function changeImage()
local health = humanoid.Health
local image = script.Parent
if health >= 150 then
image.Image = "rbxassetid://16354951180"
elseif health >= 100 then
image.Image = "rbxassetid://16354904709"
elseif health >= 50 then
image.Image = "rbxassetid://16354908663"
else
image.Image = "rbxassetid://16354956278"
end
end
-
healthChangedConnection = humanoid.HealthChanged:Connect(changeImage)
Oh and one more thing, I’m unsure how to make effects and the text say like -10 depending on health taken so if anyone could help me with that, would also need help. Thanks!
Also my first ever post so its kinda bad. never noticed I was a member her but took awhile I guess so w [it took like 2 years ]
And yes, I honestly don’t think capitalization matters here much but yeah uhm
I really need help with this.