I'm trying to make it so I can't use the tools attacks when I'm not using the tool but I can't figure out how
I tried doing "if.Script.Parent.Equipped then" but I was still able to use the moves when I didn't have the tool equipped
if script.Parent.Equipped then
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(Input)
local MouseImput = Input.UserInputType --Get all mouse inputs--
local KeyCode = Input.KeyCode --Get all keyboard inputs--
if MouseImput == Enum.UserInputType.MouseButton1 then
local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Attack) --If left click then play attack animation--
animation:Play()
script.Disabled = true
wait(1.0)
script.Disabled = false
elseif KeyCode == Enum.KeyCode.Z then
local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Bat)
animation:Play()
script.Disabled = true
wait(1.5)
script.Disabled = false
elseif KeyCode == Enum.KeyCode.X then
--not done yet--
end
end)
end
any help?

1 comment
this worked, thank you so much!