local tool = script.Parent
Energy = 0
local player = game.Players.LocalPlayer
tool.Equipped:connect(function(mouse)
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player.PlayerGui
local textLabel = Instance.new("TextLabel")
textLabel.Parent = screenGui
textLabel.Position = UDim2.new(0, 25, 0, 50)
textLabel.Size = UDim2.new(0, 150, 0, 50)
textLabel.BackgroundColor3 = BrickColor.White().Color
textLabel.Text = player.Name.." Sah dude"..Energy
tool.Unequipped:connect(function(mouse)
screenGui.Parent = nil
end)
end)
local tool = script.Parent
local keys = {}
tool.Equipped:connect(function(mouse)
mouse.KeyDown:connect(function(key) keys[key] = true end)
mouse.KeyUp :connect(function(key) keys[key] = nil end)
end)
while wait(0.2) do
if keys["f"] then
print "Charging"
Energy = Energy + 5
elseif keys["z"] and keys["x"] and Energy > 49 then
print "Lol Idkek"
wait(.5)
Energy = Energy -50
end
end
Whenever I hold down the F key, my energy increases by +5 every .2 seconds, but i would have to uneqeuip and then re-equip the tool in order for the number to change. Please help, cheers.

1 comment
So, i didn't actually use what you said to fix it, but I did use what you said under consideration and made a repeat under the textlabel making it repeat the text until the parent of the screenGui is = to nil, thanks anyways, i'll still accept your answer for helping me accomplish this, lol, cheers :)