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

Why is my gun refusing to shoot?

Asked by
Mr_Unlucky 1085 Moderation Voter
6 years ago
Edited 6 years ago

Basically, I want my gun to shoot, but it refuses to! There are no errors too.

01local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
02local Tool = script.Parent
03local Animation = nil
04local SettingsFolder = Tool.Settings
05local MagSize = SettingsFolder.MagSize
06local MagsLeft = SettingsFolder.MagsLeft
07local CurrentBullets = SettingsFolder.CurrentBullets
08local Damage = SettingsFolder.Damage
09local MouseDown = false
10local IsReloading = false
11local IsEquipped = false
12local CanShoot = true
13local Mouse = game.Players.LocalPlayer:GetMouse()
14 
15Tool.Equipped:Connect(function()
View all 90 lines...
0
In lines 57 and 82, you’re converting 0 to false. User#19524 175 — 6y
0
Is the gun not shooting in studio, or ingame, or both? Talveka 31 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

game.Players.LocalPlayer.Character:WaitForChild("Humano

Second line,maybe you didnt write "Humanoid" well

Ad
Log in to vote
0
Answered by
Talveka 31
6 years ago
Edited 6 years ago

If your gun shoots in studio while testing, but not ingame, then it might be an FE issue. In FE, things like Instance.new wont go through, so you're going to have to use a RemoteEvent. Here's a tutorial on RemoteEvent; Tutorial

Answer this question