Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
TNTIsLyfe 152
4 years ago
Edited 4 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

Log in to vote
1
Answered by
Nckripted 580 Moderation Voter
4 years ago

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.

0
NYA NYA NYA the event is activvated through a replicatedstorage fire not a touched TNTIsLyfe 152 — 4y
0
welp the damage thing u gave i just figured out prob on my own this instant and ur animation thing doesnt work TNTIsLyfe 152 — 4y
0
how do i even do this animation thing its so annoying ugh TNTIsLyfe 152 — 4y
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? TNTIsLyfe 152 — 4y
View all comments (4 more)
0
You have to set your animation core to Action, make sure you did that. Nckripted 580 — 4y
0
wut does that mean ? TNTIsLyfe 152 — 4y
0
oof still doesnt work i changed it to action TNTIsLyfe 152 — 4y
0
oh ok ur action thing worked ty TNTIsLyfe 152 — 4y
Ad

Answer this question