I made a post similar to this yesterday; I got the aim part to work to where you can’t aim when the tool is unequipped. In the script, I made it so ANY tool that is equipped can aim. I’m unsure how to fix this. This is the code with the whole aim thing in it.
local function AimIn()
idleAnim:Stop()
aimAnim:Play()
game.Workspace.Camera.FieldOfView = 50
end
local function AimOut()
aimAnim:Stop()
idleAnim:Play()
game.Workspace.Camera.FieldOfView = 70
end
mouse.Button2Down:Connect(function()
local char = player.Character
local equippedTool = char:FindFirstChildWhichIsA("Tool")
if equippedTool then
print("equipped tool")
AimIn()
else
print("No Tool Equipped")
end
end)
mouse.Button2Up:Connect(function()
local char = player.Character
local equippedTool = char:FindFirstChildWhichIsA("Tool")
if equippedTool then
print("equipped tool")
AimOut()
else
print("No Tool Equipped")
end
end)