I'm programming a Gun, and It's not "firing", I'm only working on sounds, mechanics, and animations. Not the Actual Statistics, is there something I did wrong?, I feel as if it's something to do with the way I've formatted the if Statements counteracting any functionality for Logical reasons.
I've had a lot of problems with tool.Activated before, it never runs. Am I doing something wrong with that too?
Here's the Script
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character
local Revolver = Player:WaitForChild("Backpack"):WaitForChild("Revolver")
local Handle = Revolver:WaitForChild("Handle")
local GunSounds = {
GunEquipped = Handle:FindFirstChild("GunEquipped");
GunFired = Handle:FindFirstChild("GunFired");
GunReloaded = Handle:FindFirstChild("GunReloaded")
};
local GunAnimations = {
GunEquiping = Character:FindFirstChild("Humanoid"):LoadAnimation(Handle:FindFirstChild("GunEquip"));
GunFiring = Character:FindFirstChild("Humanoid"):LoadAnimation(Handle:FindFirstChild("GunFire"));
GunReloading = Character:FindFirstChild("Humanoid"):LoadAnimation(Handle:FindFirstChild("GunReload"));
};
local Bullets = 1
local Fired = nil
local Reloading = nil
local Equipped = nil
local Unequipped = nil
local PlayerDirect = Revolver.Parent.Parent
Revolver.Equipped:Connect(function(Cursor)
if Revolver and Equipped then return end
Equipped = true
if Revolver and Player then
spawn(function()
GunSounds.GunEquipped:Play()
end)
if Character:FindFirstChild("Humanoid") then
GunAnimations.GunEquiping:Play()
end
end;
Unequipped = false
end)
Revolver.Activated:Conenct(function()
if Revolver and not Reloading then return end
Fired = true
print("GunFired")
if Revolver and Player then
spawn(function()
GunSounds.GunFired:Play()
end)
Bullets = Bullets - 1
if Bullets < 1 then
Reloading = true
end;
if Reloading then
spawn(function()
GunSounds.GunReloaded:Play()
end)
if Character:FindFirstChild("Humanoid") then
GunAnimations.GunReloading:Play()
end
Bullets = Bullets + 1
Reloading = false
end
end;
end)
Revolver.Unequipped:Connect(function(Cursor)
if Revolver and Unequipped then return end
Unequipped = true
spawn(function()
GunSounds.GunEquipped:Play()
end)
Equipped = false
--//
end)
Thank you

4 comments
ur gun is in a mess
Only problem I can see off the bat is your reloading. Since there's no delay, it reloads instantly. Mind giving more context, errors, etc?
thank you, I'll be sure to work on that, I knew I forgot something, I spent too long debugging before I could remember to put the delay
But I'm more concerned as the print("Fired") isn't being, Fired. It's not even reading the Click