this is a hammer tool and i have made about 3 damn posts about it
this time the animation only plays specfically for me. i tried this on an alt, and even had someone test it out, and it won’t work at all. somehow i can see it, like my specfic account
its not client sided it’s a server script
local tool = script.Parent
local handle = tool.Handle
local model = tool.Model
local hitbox = model.Hitbox
local animation = script.Animation
local db = false
local cooldown = 5
for i, Parts in pairs(model:GetChildren()) do
if Parts:IsA("BasePart") then
local weld = Instance.new("WeldConstraint")
weld.Part0 = Parts
weld.Part1 = handle
weld.Parent = Parts
end
end
tool.Activated:Connect(function()
if not db then db = true
local character = tool.Parent
local humanoid = character:WaitForChild("Humanoid")
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
local attack
attack = hitbox.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
attack:Disconnect()
humanoid:TakeDamage(50)
handle.Hit:Play()
else
handle.Miss:Play()
end
end)
wait(cooldown)
attack:Disconnect()
db = false
end
end)
tool.Equipped:Connect(function()
local sound = tool.Handle.Music
sound:Play()
sound.Looped = true
tool.Unequipped:Connect(function()
sound:Stop()
end)
end)