Hello, I am currently creating a game with a bar/meter but I don’t know the best way to make it.
This is what it looks like.
It is located in starter gui with a background and the meter/bar itself.
I have experimented with it before and have made the bar change depending on an int value called “value”
Here is the script:
local plr = game.Players.LocalPlayer
local Character = plr.Character
local char = Character:WaitForChild(“Humanoid”)
local value = game.StarterGui.Value
local Meter = script.Parent
value.Changed:Connect(function()
Meter.Size = UDim2.new(value.Value/100,0,1,0)
end)
The problem is I don’t know if this is efficient. Also, I want to be able to change the amount based on actions like using a tool or being in a region and I want effects to take place like killing the player if the bar hits 0 which I think can be done with remote events to the server. I’m not asking for a full script I just want some links, answers, or suggestions.