local player=game.Players.LocalPlayer
mouse=player:GetMouse()
on=false
battery=script.Parent.Parent.battery.power
local csd=coroutine.create(function()
while on==true and wait(1/6) do
print("test")
battery.Size=battery.Size+UDim2.new(-0.01,0,0)
wait(1.5)
end
end)
mouse.KeyDown:connect(function(key)
--code
end)
charge=false
script.Parent.Parent.filter.Changed:connect(function(changed)
if script.Parent.Parent.filter.Visible==true then
print("charging")
charge=true
coroutine.yield(csd)
else
print("not charging")
charge=false
coroutine.resume(csd)
end
end)
Why is it doing this? Any help would be appreciated
