Why isn't my animation working, and why isn't the part sticking to my hand?
I'm trying to create a chidori script, but the part is just staying where it was spawned when I move, and the animation isn't playing. Here's my script so far:
01 | local player = game.Players.LocalPlayer |
02 | local Mouse = player:GetMouse() |
04 | game:GetService( "UserInputService" ).InputBegan:connect( function (input,proc) |
05 | if input.KeyCode = = Enum.KeyCode.C then |
06 | local x = Instance.new( "Part" , workspace) |
11 | x.Size = Vector 3. new( 0 , 0 , 0 ) |
12 | x.BrickColor = BrickColor.new( "Cyan" ) |
13 | x.CFrame = player.Character.RightHand.CFrame*CFrame.new( 0 , 0 , 0 ) |
14 | local y = Instance.new( "BodyVelocity" , x) |
15 | y.maxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
16 | y.Velocity = player.Character.RightHand.CFrame.lookVector* 0 |
17 | local aa = script.particle 1 :Clone() |
19 | Mouse.Move:connect( function () |
20 | y.velocity = CFrame.new(player.Character.RightHand.Position,Mouse.Hit.p).lookVector* 0 |
21 | char = game.Players.LocalPlayer.Character |
22 | humanoid = char:WaitForChild( "Humanoid" ) |
24 | a = Instance.new( "Animation" ) |
25 | a.Name = "lightning blade" |
28 | aLoaded = humanoid:LoadAnimation(a) |
30 | game.Debris:AddItem(x, 2 ) |