Hello! After reworking my ability system to include modules, I have a problem to fix:
--Server Script
rs.Remotes.SkillDown.OnServerEvent:Connect(function(plr, ability, magic, holding)
holding = true
Magic[magic][ability](plr, holding)
end)
rs.Remotes.SkillUp.OnServerEvent:Connect(function(plr, ability, magic, holding)
holding = false
end)
--Module Script
return function(plr, isHoldingDown)
while isHoldingDown == true do wait()
if charge <= 100 then
charge = charge + 1
iterator = iterator + 0.1
circle.Size = circle.Size + Vector3.new(0,0.05,0.05)
end
if charge == 100 then
break
end
end
end
My problem is that I can’t communicate to the module script whenever isHoldingDown
turns false, so therefore the charge always maxes out to 100, not taking into account whether I release the key before the charge reaches 100 or not.
How can I fix this?