So I was trying to make a gun on roblox. I used instance.new to make the bullet but the instance fired multiple times. Can someone help me out? Please Respond as soon as possible.(here is the code)
local Players = game:GetService("Players") local player = Players.LocalPlayer local mouse = player:GetMouse() script.Parent.Activated:Connect(function() mouse.Move:Connect(function() mouse.Button1Down:Connect(function() local Bullet = Instance.new("Part") wait(2) Bullet.Parent = workspace Bullet.CFrame = mouse.Hit end) end) end)
Hmmm, maybe try waiting 5 seconds and put self:Destroy() ?
I'm not sure if this'll work, but it's worth a try