Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Bullet Being Created Multiple Times?

Asked by 3 years ago
Edited 3 years ago

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)
0
Please answer i really need this. It would mean a lot. Littlebigplanet40000 77 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Hmmm, maybe try waiting 5 seconds and put self:Destroy() ?

I'm not sure if this'll work, but it's worth a try

0
That Might work ill try that Littlebigplanet40000 77 — 3y
0
did it work? StarzSketchez 31 — 3y
0
Kinda, it's still a bit laggy but it works Littlebigplanet40000 77 — 3y
Ad

Answer this question