RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"add a gun"
-- local script for gun local tool = script.Parent local mouse = nil local gun = tool.Gun local shootSound = gun.ShootSound local bullet = gun.Bullet tool.Equipped:Connect(function() mouse = game.Players.LocalPlayer:GetMouse() mouse.Button1Down:Connect(function() shootSound:Play() local bulletClone = bullet:Clone() bulletClone.Parent = game.Workspace bulletClone.CFrame = gun.CFrame bulletClone.Velocity = gun.CFrame.lookVector * 1000 game.Debris:AddItem(bulletClone, 2) end) end) tool.Unequipped:Connect(function() if mouse then mouse.Button1Down:Disconnect() end end)