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:
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
game:GetService("UserInputService").InputBegan:connect(function(input,proc)
if input.KeyCode == Enum.KeyCode.C then
local x = Instance.new("Part", workspace)
x.Anchored = true
x.CanCollide = false
x.Material = "Neon"
x.Transparency = 1
x.Size = Vector3.new(0,0,0)
x.BrickColor = BrickColor.new("Cyan")
x.CFrame = player.Character.RightHand.CFrame*CFrame.new(0,0,0)
local y = Instance.new("BodyVelocity", x)
y.maxForce = Vector3.new(math.huge,math.huge,math.huge)
y.Velocity = player.Character.RightHand.CFrame.lookVector*0 -- 0 = Speed Number
local aa = script.particle1:Clone()
aa.Parent = x
Mouse.Move:connect(function()
y.velocity = CFrame.new(player.Character.RightHand.Position,Mouse.Hit.p).lookVector*0
char = game.Players.LocalPlayer.Character
humanoid = char:WaitForChild("Humanoid")
a = Instance.new("Animation")
a.Name = "lightning blade"
a.AnimationId = "http://www.roblox.com/asset/?id=863853460"
a.Parent = x
aLoaded = humanoid:LoadAnimation(a)
end)
game.Debris:AddItem(x,2)
end
end)

2 comments
Format your code in Lua code block, please.
i don't know how to do that ;-;