So currently if you press 't' a kicking animation occurs, but I wan't it to only happen if you have the tool equipped. How would I do that?
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")
local tool = script.Parent
local Mouse = Player:GetMouse()
local kicking = Instance.new("Animation", Humanoid)
kicking.AnimationId = "http://www.roblox.com/item.aspx?id=273619670"
local function keyDown(key)
key = key:lower()
if key == 't' then
local animTrack = Humanoid:LoadAnimation(kicking)
animTrack:Play()
end
end
function checkHit()
local rLeg = Character:WaitForChild("Right Leg")
local damage = 15
rLeg.Touched:connect(function(toucher)
if toucher.Parent.Humanoid then
local hitHuman = toucher.Parent.Humanoid
hitHuman.Health = hitHuman.Health - damage
elseif toucher.Humanoid then
local hitHuman2 = toucher.Humanoid
hitHuman2.Health = hitHuman2.Health - damage
end
end)
end
Mouse.KeyDown:connect(keyDown, checkHit)
Yes It's inside of a tool, and It's a local script.

2 comments
I'd create a local named equipped, keep it as false. when equipped fires, make the value true. when unequip fires, make it false. It's what I did for my check script.
How would I do that?