Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UI = {}
- -- // StarterGui.Basic Health GUI \ --
- UI["1"] = Instance.new("ScreenGui", game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"))
- UI["1"]["Name"] = [[Basic Health GUI]]
- UI["1"]["ResetOnSpawn"] = false
- -- // StarterGui.Basic Health GUI.Healthbar \ --
- UI["2"] = Instance.new("Frame", UI["1"])
- UI["2"]["Active"] = true
- UI["2"]["BorderSizePixel"] = 0
- UI["2"]["BackgroundColor3"] = Color3.fromRGB(0, 26, 0)
- UI["2"]["AnchorPoint"] = Vector2.new(1, 0)
- UI["2"]["Size"] = UDim2.new(0.1, 0, 0.02, 10)
- UI["2"]["Position"] = UDim2.new(1, -20, 0, -20)
- UI["2"]["BorderColor3"] = Color3.fromRGB(149, 105, 17)
- UI["2"]["Name"] = [[Healthbar]]
- -- // StarterGui.Basic Health GUI.Healthbar.Healthbar \ --
- UI["3"] = Instance.new("Frame", UI["2"])
- UI["3"]["BorderSizePixel"] = 0
- UI["3"]["BackgroundColor3"] = Color3.fromRGB(0, 135, 0)
- UI["3"]["Size"] = UDim2.new(1, 0, 1, 0)
- UI["3"]["BorderColor3"] = Color3.fromRGB(149, 105, 17)
- UI["3"]["Name"] = [[Healthbar]]
- -- // StarterGui.Basic Health GUI.Healthbar.Healthbar.LocalScript \ --
- UI["4"] = Instance.new("LocalScript", UI["3"])
- -- // StarterGui.Basic Health GUI.Healthbar.percentage \ --
- UI["5"] = Instance.new("TextLabel", UI["2"])
- UI["5"]["TextWrapped"] = true
- UI["5"]["TextScaled"] = true
- UI["5"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255)
- UI["5"]["TextSize"] = 14
- UI["5"]["FontFace"] = Font.new([[rbxasset://fonts/families/SourceSansPro.json]], Enum.FontWeight.Bold, Enum.FontStyle.Normal)
- UI["5"]["TextColor3"] = Color3.fromRGB(255, 255, 255)
- UI["5"]["BackgroundTransparency"] = 1
- UI["5"]["AnchorPoint"] = Vector2.new(0.5, 0.5)
- UI["5"]["Size"] = UDim2.new(1, 0, 1, 0)
- UI["5"]["BorderColor3"] = Color3.fromRGB(28, 43, 54)
- UI["5"]["Text"] = [[100%]]
- UI["5"]["Name"] = [[percentage]]
- UI["5"]["Position"] = UDim2.new(0.5, 0, 0.5, 0)
- -- // StarterGui.Basic Health GUI.Healthbar.percentage.UIStroke \ --
- UI["6"] = Instance.new("UIStroke", UI["5"])
- UI["6"]["Thickness"] = 3
- -- // StarterGui.Basic Health GUI.Healthbar.UIStroke \ --
- UI["7"] = Instance.new("UIStroke", UI["2"])
- UI["7"]["Thickness"] = 3
- UI["7"]["Color"] = Color3.fromRGB(0, 81, 26)
- -- // StarterGui.Basic Health GUI.Script \ --
- UI["8"] = Instance.new("Script", UI["1"])
- -- // Notification Sending (Moved to Separate Thread) \ --
- task.spawn(function()
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "Made By bruhmoments#5852",
- Text = "Healthbar Loaded!",
- Duration = 10, -- Set a finite duration (infinite might not work)
- Button1 = "Okay"
- })
- end)
- -- // StarterGui.Basic Health GUI.Healthbar.Healthbar.LocalScript \ --
- local function SCRIPT_4()
- local script = UI["4"]
- local P = game:GetService("Players").LocalPlayer -- LocalPlayer Variable
- local C = P.Character or P.CharacterAdded:Wait() -- Character Variable
- local H = C:WaitForChild("Humanoid") -- Humanoid Variable
- H.HealthChanged:connect(function()
- script.Parent:TweenSize(UDim2.new(1/(H.MaxHealth/math.floor(H.Health + .5)),0,1,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, .25)
- script.Parent.Parent.percentage.Text = tostring(math.floor(100/(H.MaxHealth/H.Health)).."%")
- end)
- end
- task.spawn(SCRIPT_4)
- return UI["1"], require
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement