I'm trying to make a game where you have guns, And im currently making a gun that functions as an AK47. So i want it to rapid fire until you take your finger off the mouse button. So im using values. However the 'Changed' Is somehow nil? Can somebody help?
local Shoot = script:FindFirstChild("Shoot")
script.Parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
Shoot.Value = true
end)
end)
script.Parent.Equipped:Connect(function(mouse)
mouse.Button1Up:Connect(function()
Shoot.Value = false
end)
end)
script.Parent.Equipped:Connect(function(mouse)
Shoot.Changed:Connect(function()
while Shoot.Value == true do
game:GetService("ReplicatedStorage"):FindFirstChild("BRRRRREvent"):FireServer(script.Parent.ScopePart.Position, mouse.Hit.Position)
wait(0.05)
end
end)
end)
Errors happening at
script.Parent.Equipped:Connect(function(mouse)
Shoot.Changed:Connect(function()
while Shoot.Value == true do
end)

1 comment
Value is also nil