Everything works, but it isn’t playing the animations any clue why?
tool = script.Parent
debounce = nil
function Attack()
if debounce == nil then
print("0")
local anim = tool:WaitForChild("Animation")
local humanoid = script.Parent.Parent:WaitForChild("Humanoid")
local animTrack = humanoid:LoadAnimation(anim)
animTrack:Play()
debounce = true
wait(3)
debounce = nil
end
end
tool.Activated:Connect(Attack)
tool.Handle.HitBox.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid.Parent ~= tool.Parent and debounce == true then
print("1")
humanoid.Health -= 3
end
end)
3 Likes
dashypoo17
(DevWasUntaken)
December 14, 2023, 7:59pm
#2
did you put the animation under the tool?
1 Like
Yes i did seing in this picture, I also put an animation id in it!
1 Like
dashypoo17
(DevWasUntaken)
December 14, 2023, 8:00pm
#4
in the script you named it tool but the tool is called scythe
1 Like
But that is the variable it has nothing to do with that?
1 Like
dashypoo17
(DevWasUntaken)
December 14, 2023, 8:01pm
#6
oh ok lemme check the script
14174791645781g3uibdijnfwg3ehgeg
1 Like
Maybe the Animation ID is invalid?
1 Like
edvaardss
(edvaardss)
December 14, 2023, 8:03pm
#8
Does it show any errors? about the animation? Is it your animation?
1 Like
dashypoo17
(DevWasUntaken)
December 14, 2023, 8:03pm
#9
did u make the script r15 or r6 and make sure you make the animation a r15 or r6 whatever the script is
1 Like
Players.SpiderLeander1.Backpack.Scythe.Script:23: attempt to index nil with ‘Parent’
2 Likes
I made the animation R15 my game is also R15 so it should work!
1 Like
dashypoo17
(DevWasUntaken)
December 14, 2023, 8:06pm
#12
but is the script r15?
1241wfqefwedfwegfwergwegwgwgw
1 Like
What do you mean is the script r15?
1 Like
dashypoo17
(DevWasUntaken)
December 14, 2023, 8:08pm
#14
idrk im not very advanced at scripting
1 Like
Have you found anything useful yet?
1 Like
edvaardss
(edvaardss)
December 14, 2023, 8:11pm
#16
So the error seems to be that the code is trying to damage the player touching the part but as…
Im currently looking into it there a problem on line 23
1 Like
Yeah and it`s also not playing the animation!
1 Like
edvaardss
(edvaardss)
December 14, 2023, 8:14pm
#18
When did you create the animation? today yesterday or?
1 Like
I think yesterday, but i don`t actually know
1 Like
edvaardss
(edvaardss)
December 14, 2023, 8:15pm
#20
Cause sometimes you need to wait until it gets trough moderation
you have been creating animations in the past or just starting?
1 Like