Hi So i have this gui you will notice a red and black bar i have them seperate just for a visual so i want the black bar to show and i want the red abr to slowly fill up the blackbar over time i will show you the gui i made this for
I have started a script (dont make fun of me i am very bad at scripting) i dont know how to get it to work like i explained above
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local PowerLevel = 100
local PowerLevel = script.Parent.Frame
PowerLevel.Size = UDim2.new(1, 0, 1, 0)
Character:WaitForChild("Humanoid").Changed:Connect(function(property)
if property == "PowerLevel" then
PowerLevel.Size = UDim2.new(Character.Humanoid.PowerLevel / 100, 0, 1, 0)
end
end)
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.R then
Character.Humanoid.Powerlevel = PowerLevel
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.R then
local ReplicatedStorage:FindFirstChild = "Serious"
Character.Humanoid.PowerLevel = PowerLevel
end
end
end)
while true do
if not PowerLevel and PowerLevel < 100 then
PowerLevel = math.min(PowerLevel + 0.5, 100)
PowerLevel:TweenSize(UDim2.new(PowerLevel / 100, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
end
wait(0.1)
print(PowerLevel, PowerLevel.Size)
end