Player = game.Players.LocalPlayer Character = Player.Character Mouse = Player:GetMouse() run = game:GetService("RunService") function Kick() print("LOL") for i = 1, 10 do Leg = Character["Right Leg"] Leg.c0 = Leg.c0 *CFrame.Angles(0, 0, 0.15) run.Stepped:wait() end end Mouse.Button1Down:connect(Kick)
Yeah, so basically tried to make it so once Button1 is pressed your left leg will kick.
However, I get an error...
16:14:38.321 - C0 is not a valid member of Part 16:14:38.321 - Script 'Players.Player.Backpack.Karate', Line 9 16:14:38.321 - Stack End
Any soloutions!?
The issue is that you are attempting to set the C0
of the character's leg. What you want to do is set the C0
property of the character's left hip:
Player = game.Players.LocalPlayer Character = Player.Character Mouse = Player:GetMouse() run = game:GetService("RunService") function Kick() print("LOL") for i = 1, 10 do Hip = Character.Torso["Left Hip"] Hip.C0 = Hip.C0 *CFrame.Angles(0, 0, 0.15) run.Stepped:wait() end end Mouse.Button1Down:connect(Kick)
I'm assuming the rest of the script is incomplete, however.
You could always just make an animation in Studio and run it with the script instead.