- What do i want to achieve?
- A bolt action rifle that doesn’t fire like an MG42
- Rifle varieties (like semi-auto) (optional)
- What’s the problem?
- To be honest, it will just complicates things so i just want ways and a fix just only for the problem that makes the rifle fires like an MG42 when mashing the left mouse key and like make it fire once even if the player is mashing the mouse button
- Extras
mouse.Button1Down:Connect(function()
if isFiring then return end
isFiring = true --// problem
for i, v in pairs(framework.viewmodel:GetChildren()) do
if v:IsA("Animation") then
v.AnimationId = framework.module.animations.fire
framework.viewmodel:WaitForChild("Humanoid"):LoadAnimation(v):Play()
local sound = Instance.new("Sound", char.PrimaryPart)
sound.SoundId = framework.module.sounds.fire
sound.PlayOnRemove = true
sound:Destroy()
end
end --// ignore this.
task.wait(framework.module.FireTime) --// problem too
isFiring = false --// problem again
end)
mouse.Button1Up:Connect(function()
isFiring = false --// for SMGs or LMGs, but this isn't the issue tho. Trust me, it took me 10 hours.
end)
Note this is a StarterCharacterScript.
I would try for the RemoteEvent but I dont think it will be successful too…
For now please help me with this rifle-ish issue!