Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

No errors but my animation is not playing? and please help me with my damage script?

Simple my animation script shows no errors but the animation is still not playing its confusing can u tell me wuts wrong? Local script:

local Hit = false
local cooldown = false
script.Parent.Activated:Connect(function()
if cooldown == false then
cooldown = true
print("ok")

local player = game.Players.LocalPlayer
local Char = player.Character:FindFirstChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://04848001315"

local AnimationLoad = Char:LoadAnimation(animation)
AnimationLoad:Play()
Hit = true wait (0.5)
Hit = false wait (1)
cooldown = false
script.Parent.Sword.Touch.Touched:Connect(function(part)
print("yo")
if Hit == true then 
game.ReplicatedStorage.Tag:FireServer(part.Parent)

game.ReplicatedStorage.Ow:FireServer(part.Parent)


end
end)
end
end)

Also can u help me with my damage script? it keeps showing a error of the humanoid not being a child of the character so im confused Script =

game.ReplicatedStorage.Ow.OnServerEvent:connect(function(Character)
Character.Humanoid.Health = Character.Humanoid.Health - script.Parent.Value

1 answer

✓ Accepted answer

For the damage, you need to put this:

script.Parent.Touched:Connect(function(character)
	if character.Parent.Humanoid then
		character.Parent.Humanoid.Health = 0
	end
end

The code would have worked, but it probably got the lower leg and searched for a humanoid in the lower leg. As for the animation, try putting it in a server script.

8 comments

0

NYA NYA NYA the event is activvated through a replicatedstorage fire not a touched

0

welp the damage thing u gave i just figured out prob on my own this instant and ur animation thing doesnt work

0

how do i even do this animation thing its so annoying ugh

1

For some reason the animation doesnt work on swords because it worked on the arm without sword but it wont work with the sword so can u help me fix dis?

0

You have to set your animation core to Action, make sure you did that.

0

wut does that mean ?

0

oof still doesnt work i changed it to action

0

oh ok ur action thing worked ty

This discussion is preserved as it was. New answers, comments, and votes are closed.