This Video Is A Tutorial.
Edits By Fotor.
www.fotor.com/photo-editor-ap...
Edits by InShot.
inshotshare.app
Sub Goal: 100 Subs, Come Sub If You Want:
/ @dabeargaming1
Chapters:
00:00 Hi
00:02 Tutorial
01:03 Bye:)
Links:
-Roblox-
Roblox Profile: www.roblox.com/users/44270280...
Roblox Game: www.roblox.com/games/15395389...
-KZitem-
Video Playlist: • Videos
Channel: @Dabaergaming1
Script:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local tweenService = game:GetService("TweenService")
-- Create BillboardGui
local billboardGui = Instance.new("BillboardGui")
billboardGui.Parent = character.Head -- Parent to the character's head
billboardGui.Size = UDim2.new(0, 200, 0, 20) -- Set size
billboardGui.StudsOffset = Vector3.new(0, 3, 0) -- Offset from the head
-- Create Frame for Health Bar
local backgroundFrame = Instance.new("Frame")
backgroundFrame.Size = UDim2.new(1, 0, 1, 0) -- Fill the BillboardGui
backgroundFrame.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
backgroundFrame.BorderSizePixel = 0
backgroundFrame.Parent = billboardGui
-- Create UIStroke for Background Frame
local uiStroke = Instance.new("UIStroke")
uiStroke.Thickness = 4
uiStroke.Color = Color3.fromRGB(0, 0, 0) -- Black stroke color
uiStroke.Parent = backgroundFrame
-- Create UICorner for Background Frame
local uiCornerBackground = Instance.new("UICorner")
uiCornerBackground.CornerRadius = UDim.new(0.2, 5)
uiCornerBackground.Parent = backgroundFrame
-- Create Health Bar Frame
local healthBarFrame = Instance.new("Frame")
healthBarFrame.Size = UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 1, 0)
healthBarFrame.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
healthBarFrame.BorderSizePixel = 0
healthBarFrame.Parent = backgroundFrame
-- Create UICorner for Health Bar
local uiCornerHealthBar = Instance.new("UICorner")
uiCornerHealthBar.CornerRadius = UDim.new(0.2, 5)
uiCornerHealthBar.Parent = healthBarFrame
-- Create Health Text
local healthText = Instance.new("TextLabel")
healthText.Size = UDim2.new(0.8, 0, 1, 0) -- Adjusted size to fit text
healthText.Position = UDim2.new(0.1, 0, 0, 0) -- Align to the left with some padding
healthText.Text = "100/100"
healthText.TextScaled = true
healthText.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
healthText.Font = Enum.Font.FredokaOne -- Fredoka One font
healthText.BackgroundTransparency = 1
healthText.Parent = backgroundFrame
-- Function to update health bar
local function updateHealth()
local currentHealth = humanoid.Health
local maxHealth = humanoid.MaxHealth
local healthPercentage = math.round((currentHealth / maxHealth) * 100)
healthText.Text = tostring(currentHealth) .. "/" .. tostring(maxHealth)
local tween = tweenService:Create(healthBarFrame, TweenInfo.new(0.35, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), { Size = UDim2.new(currentHealth / maxHealth, 0, 1, 0) })
tween:Play()
end
-- Connect health update event
humanoid:GetPropertyChangedSignal("Health"):Connect(updateHealth)
humanoid:GetPropertyChangedSignal("MaxHealth"):Connect(updateHealth)
-- Initial call to update health
updateHealth()
Негізгі бет Ойындар Heath Bar Billboard Gui Tutorial
Пікірлер