#tool animation
1 messages · Page 1 of 1 (latest)
Check console for errors
Does the tool have a handle? From memory, I don't think tool functions work without a handle.
I usually insert a tiny, invisible, non-collidable part to combat this.
ill try that
local tool = script.Parent
local player = game.Players.LocalPlayer
local function onEquipped()
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local replicatedStorage = game:GetService("ReplicatedStorage")
local animFolder = replicatedStorage:WaitForChild("AnimFolder")
local punchAnim = animFolder:WaitForChild("Animation")
local punchTrack = animator:LoadAnimation(punchAnim)
tool.Activated:Connect(function()
if punchTrack.IsPlaying then
punchTrack:Stop()
end
punchTrack:Play()
end)
end
if tool:IsDescendantOf(player.Character) then
onEquipped()
else
tool.Equipped:Connect(onEquipped)
end