I’m trying to make a charge system for my jojo game and I was wondering why it doesnt stop charging one it hits 100 and also how would I make another value go up by 1 when the charge value hits another 100.
local plr, stats, input = unpack(args)
local char = plr.Character or plr:IsA("Model")
local values = char.Values
local BurstCount = values.BurstCount
local ChargeHealth = values.ChargeHealth
local CantCharge = false
local keyHeld = require(MainModule.Parent.MainFunction).isKeyHeld
if ChargeHealth.Value == ChargeHealth.Value + 100 then
CantCharge = true
Functions.CreateCD(plr, "G", nil, 2)
end
repeat
ChargeHealth.Value += 1
wait(stats.TickSpeed)
until CantCharge == true or not keyHeld(plr,"G")