Bullet only created once when it should be created every .1 seconds

Hello. I made a gun, it is almost done, but for the last thing, I want to view the bullets. But for some reason, they won’t appear. Here is a video:
https://streamable.com/dfy7ja

Here are the line that is creating the bullets:

while wait(.1) do
	if isShooting and not script.Parent.Configuration.IsOnSafe.Value and not script.Parent.Configuration.IsReloading.Value and script.Parent.Ammo.Value ~= 0 then
		local rayCastParams = RaycastParams.new();
		local bulletClone = script.Bullet:Clone();
		bulletClone.Parent = workspace
		bulletClone.Position = script.Parent.Handle.Position + script.Parent.Handle.CFrame.LookVector * 0.4
		bulletClone.Anchored = false
		local bodyVelocity = Instance.new("BodyVelocity");
		local rayUnit = (mouse.Hit.p - bulletClone.Position).Unit * 250
		bodyVelocity.Velocity = rayUnit
		bodyVelocity.Parent = bulletClone
		rayCastParams.FilterDescendantsInstances = {script.Parent.Parent, script.Parent}
		rayCastParams.FilterType = Enum.RaycastFilterType.Blacklist
		rayCastParams.IgnoreWater = true
		local result = workspace:Raycast(script.Parent.Handle.Position, (mouse.Hit.p - script.Parent.Handle.Position).Unit * 250, rayCastParams);
		if result == nil then return end
		if result.Instance and result.Instance.Parent:FindFirstChildOfClass("Humanoid") then
			damageRemoteEvent:FireServer(result.Instance.Parent:FindFirstChildOfClass("Humanoid"))
		end
	else
	end
end
1 Like

check the parts then check is the parts added properly.

They are not, only 1 part is added and after no longer.

1 Like

umm then you can refer this video: Roblox Gun Tutorial - How To Make A Gun - YouTube

The whole gun is already working, but only this part is for decoration and it is necessary. (I am doing a commission)

1 Like

hmmm about this im confused too. maybe some other person would reply so then u can check it .

1 Like

Just figured out I returned the loop, so I just removed the line where I returned it.

1 Like