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

Gun Scripting FE doesn't print before firing fire event?

Asked by 5 years ago

My gun client doesn't print before firing the fire remote event! Thank you!

--HandGun Client NYDynamics

tool = script.Parent

Ammo = tool:WaitForChild('Ammo')
MaxAmmo = tool:WaitForChild('MaxAmmo')

--Remote Events

Fire = tool:WaitForChild('Fire')
Dmg = tool:WaitForChild('Dmg')
Reload = tool:WaitForChild('Reload')


--Player Var

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

--ToolEquipped

tool.Equipped:Connect(function()
    --Check For Tool
    if tool then
        --Make Sure is tool
        if tool:IsA('Tool') then
            --if is tool
            --print('Good')
            --Informs it is equipped
            print('Equipped')
            return print(tostring(tool.Name))
        else
            --if not tool
            --warn('Bad')
        end
    end
    --Check if mouse clicks
    mouse.Button1Down:Connect(function()
        if Ammo.Value > 0 then
            --Fire
            print('Fire')
        else
            --Reload

        end
    end)
end)

--ToolUnEquipped

tool.Unequipped:Connect(function()
    --Check For Tool
    if tool then
        --Make Sure is tool
        if tool:IsA('Tool') then
            --if is tool
            --print('Good')
            --Informs it is unequipped
            print('UnEquipped')
            return print(tostring(tool.Name))
        else
            --if not tool
            --warn('Bad')
        end
    end
end)
0
Why would you check if it's a tool, the ClassName never changes lol User#19524 175 — 5y
0
Idk felt like learning how to use it better NYDynamics 71 — 5y

Answer this question