How do I get my animation code to play instead of not working?
For some odd reason the code that I use to play animations for my Player isn't working. Here is the script
01 | local Player = game.Players.LocalPlayer |
02 | local Mouse = Player:GetMouse() |
04 | Mouse.KeyDown:connect( function (key) |
07 | local anim = Player.Character.Humanoid:LoadAnimation(script.Animation) |
08 | game:GetService( "Chat" ):Chat(Player.Character.Head, "BLESSED HAMMER!" , "Blue" ) |
09 | local x = game.ReplicatedFirst.Hammer.Handle:Clone() |
10 | x.Parent = game.Workspace |
11 | x.Name = "NotIceHammer" |
13 | x.CanCollide = true x.CFrame = Player.Character.Head.CFrame*CFrame.new( 0 , 6.5 , 4 )*CFrame.Angles( 0 ,math.pi/ 2 , 2 *math.pi/ 9 ) |
14 | local pe = Instance.new( "ParticleEmitter" , x) |
15 | pe.Size = NumberSequence.new( 0 , 2.62 ) |
17 | pe.EmissionDirection = Enum.NormalId.Back |
18 | pe.SpreadAngle = Vector 2. new( 0 , 360 ) |
19 | pe.Lifetime = NumberRange.new( 2.5 ) |
21 | pe.LightEmission = 0.1 |
22 | pe.Lifetime = NumberRange.new(. 5 ) |
23 | pe.Speed = NumberRange.new(. 2 ) |
24 | pe.Transparency = NumberSequence.new(. 7 ) |
25 | local bv = Instance.new( "BodyVelocity" , x) |
26 | bv.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
27 | bv.Velocity = Player.Character.Head.CFrame.upVector* 0 |
28 | local bv = Instance.new( "BodyVelocity" , x) |
29 | bv.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
30 | bv.Velocity = Player.Character.Head.CFrame.upVector* 0 |
33 | x.CFrame = x.CFrame * CFrame.fromEulerAnglesXYZ( 0 , 0 , 0 ) |
The Animation Code used in this script is what I use for other scripts like this and they work just fine. I also have tried changing the Animation Priority to "Movement" and that didn't help either.