Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't my animation working, and why isn't the part sticking to my hand?

Asked by 7 years ago
Edited by OldPalHappy 7 years ago

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
Format your code in Lua code block, please. Goulstem 8144 — 7y
0
i don't know how to do that ;-; izanagi456 4 — 7y

Answer this question