I am making a gun where you can hold click to charge up a gun, and you release click to shoot. I have kind of an idea of how to do that, but I don't know how to add a maximum charge at the same time. Like you can only charge it for a certain amount of time. The below is an if statement that charges the gun
--I want to try to add a while mouse is clicked thing, but I don't know how!
for i = 1,(game.Players.LocalPlayer.Stats.Level.Value + 4) * 10 do
bullet.Size = bullet.Size + Vector3.new(0.1,0.1,0.1)
wait(10/(game.Players.LocalPlayer.Stats.Level.Value+1)/150)
end

2 comments
That's not very realistic.
Really? theres no way to add a charge?