local function Shoot(actionName, UserInputState)
local IsShooting
if actionName == b and UserInputState == Enum.UserInputState.Begin then
IsShooting = true
elseif UserInputState == Enum.UserInputState.End then
IsShooting = false
end
while IsShooting == true and Bullets.Value > 0 do
local mousepos = mouse.Hit.Position
ShootEvent:FireServer(mousepos)
task.wait(ShotSpeed.Value)
end
end
the while loop is not working with no errors at all