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)

1 comment
Please answer i really need this. It would mean a lot.