The Animation works in studio but not in the game itself for it also works in my Showcase game, in the game itself, which is confusing, The damage isn't working as stated in the title. If anyone could help me on this it'd be great. Thanks

Script


script.Parent.Blade.Touched:connect(function(p)

if script.Parent.Damage.Value == true then

script.Parent.Damage.Value = false

p.Parent.Humanoid:TakeDamage(20)

end

end)

Local Script


local CanAttack = true

script.Parent.Activated:connect(function()

local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)

if CanAttack == true then

attack:Play()

CanAttack = false

wait(1)

attack:Stop()

CanAttack = true

script.Parent.CanDamage.Value = true

end

end)

6 comments

1

Are you sure CanDamage is inside tool?

0

Wow thanks, I completely forgot about putting one in. Can you explain the reason for the animation though, that's what's really bothering me, it works in all my other games but not the Tycoon I want it in.

0

You could try defining the AnimationTrack prior to the event firing. If that doesn't work then you could try playing the anims on the server with a RemoteEvent, but you shouldn't have to do that cause Character replication.

0

What do you mean by "Defining the AnimationTrack" how exactly would I do that?

0

In your LocalScript, the attack variable would be your AnimationTrack. Define it outside of the event to "preload" the animation in a sense. You can read more about AnimationTracks here: http://wiki.roblox.com/index.php?title=Animations#AnimationTrack

0

thanks