Hi everyone, I made an old post asking for help on a healing station but it died so I was wondering if anyone is willing to help with this one.
I am trying to make a healing station like in @UmmmOkayWhat ’s rickey rat where it can give you health but it slowly goes down as its used.
– my current script –
script.Parent.Triggered:Connect(function(player)
player.Character.Humanoid.Health = player.Character.Humanoid.Health + 10
end)
The healing part is fine and working but I just want it to disable after too many uses like this
You can make a number value and decrease it every time it gets used.
do an if statement to check if the number is higher than 0
1 Like
What I did is I used 2 number values, one for the current value and one for the max value. Decrease the current value everytime the station is used. Then simply change the billboard GUI’s X size to the current value / the max value
1 Like
Thanks so much! I am developing a horror game right now inspired by yours!
I wish you the best of luck on your game!
1 Like
Forummer
(Forummer)
July 6, 2022, 1:15pm
7
I assume your BillboardGui has a ‘health’ ImageLabel, what they’re suggesting is that you set its ‘Size’ property to the following.
healthBar.Size = UDim2.new(currentValue / maxValue, 0, 1, 0)
This may not be exactly what you need but should give you a general idea of what you need to do.
1 Like