#my code animation dosnet load

1 messages · Page 1 of 1 (latest)

royal crown
#

lua
local Tool = script.Parent
local Idle_Track
local Character

local Debounces = {
Touch = false;
Hit = false;
Activate = false;
}

Tool.Equipped:Connect(function()
Character = Tool.Parent

Idle_Track = Character:WaitForChild('Humanoid'):LoadAnimation(script:WaitForChild('Idle'))
Idle_Track:Play()

end)

Tool.Unequipped:Connect(function()

if Idle_Track then
    Idle_Track:Stop()
    Idle_Track = nil
end

end)

Tool.Activated:Connect(function()
if Debounces.Activate then return end
Debounces.Activate = true

local Attack_Track = Character:WaitForChild('Humanoid'):LoadAnimation(script:WaitForChild('Attack'))
Attack_Track:Play()

Debounces.Hit = true
Attack_Track.Stopped:Wait()

Debounces.Hit = false
Debounces.Activate = false

end)

Tool:WaitForChild('Handle').Touched:Connect(function(partWeHit : BasePart)
if Debounces.Touch or not Debounces.Hit then return end
Debounces.Touch = true

local Humanoid =  partWeHit.Parent:FindFirstChildOfClass('Humanoid')

if  Humanoid and Humanoid.Parent ~= Character then
    Debounces.Hit = false
    Humanoid:TakeDamage(35)
end

Debounces.Touch = false

end)

tidal fossil
#

bro...

lua
     if Idle_Track then
        Idle_Track:Stop()
        Idle_Track = nil
    end
end)```

is this the actual start of the script?
royal crown
#

ok i did it now?,

tidal fossil
#

oh you fixed the bug?

royal crown
#

no i forgot to write the start

tidal fossil
#

oh

#

are there any errors showing in the output window?

royal crown
#

no it works but just animation

tidal fossil
#

mabye you didn't save the animation properly?

royal crown
#

im gonna at next day so im not gonna fix now