You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want the stamina and health bar to diminish like they would with a frame as the bar.
What is the issue? Include screenshots / videos if possible!
It diminishes strangely.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked for solutions on the forum and I couldn’t find anything similar to this.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
this is the part of the script that changes the gui script.Parent.PlayerName.Text = Player.Name
script.Parent.Frame.Frame.PlayerThumb.Image = “rbxthumb://type=AvatarHeadShot&id=” … Player.UserId … “&w=420&h=420”
– Animation ID for running animation
local RunningAnimationId = “rbxassetid://13514845732”
– Load the running animation
local RunAnim = Instance.new(‘Animation’)
RunAnim.AnimationId = RunningAnimationId
local PlayRunAnim = Humanoid:LoadAnimation(RunAnim)
It might be, I tried tweening the position of it and moving it to the left into the player icon but its initial position was on the right of my screen when I did that.
local initialPosition = script.Parent.StaminaBar.Bar.Position
local function UpdateStaminaBar()
local targetPosition = UDim2.new(Stamina / 100, 0, 1, 0) – Calculate the target position of the stamina bar based on the stamina value
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear) -- Define the tween animation duration and easing style
local tween = TweenService:Create(script.Parent.StaminaBar.Bar, tweenInfo, {Position = initialPosition + targetPosition}) -- Create the tween animation, adding the target position to the initial position
tween:Play() -- Play the tween animation
script.Parent.StaminaBar.Bar.Visible = Stamina > 0
end
local lastSprintTime = tick() – Track the last time sprinting started