I want to make it so when you hold down the Button for a Flashlight, the Power percentage drops from 100, but the Script breaks when I try this in the main function:
mouse.KeyDown:connect(function(key)
if string.byte(key) == 50 then
L.Enabled = true
while wait(3) do
game.Lighting.PValue.Value = game.Lighting.PValue.Value - 1
end
end
end)
The script inside the GUI:
while true do
script.Parent.Text = game.Lighting.PValue.Value
end
