im trying to make a directional rapier sword, and i have no idea why this is considered an error, if i change it to only 0.1 instead of 0.1, 0.1, 0.1 it gives out an error called Players.realTongoKong.Backpack.Rapier.Script:8: attempt to index nil with 'Character' and i get an error like this Players.realTongoKong.Backpack.Rapier.Script:14: Expected 'then' when parsing if statement, got ',' if i use 0.1, 0.1, 0.1
do i need to change the values in some way or is it something else?
really sorry if this is a silly question im still new to scripting n all that stuff
full script:
script.Parent.Activated:Connect(function()
local swingRightAnimation = script.Parent.Animations.SwingRight
local stabAnimation = script.Parent.Animations.Stab
local humanoid = script.Parent.Parent.Humanoid
local player = game.Players:GetPlayerFromCharacter(script.Parent)
local Character = player.Character or player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local swingRightAnimationTrack = humanoid:LoadAnimation(swingRightAnimation)
local stabAnimationTrack = humanoid:LoadAnimation(stabAnimation)
if CFrame.LookVector < 0.1, 0.1, 0.1 then swingRightAnimationTrack:Play()
end
end)

4 comments
@Mathilinium made a bit of a mistake, so on his code on line 12 change the CFrane,new(0.1, 0.1, 0.1) to Vector3.new(0.1, 0.1, 0.1)
CFrame.LookVector returns a vector3 not a CFrame. You should learn about them on the developer wiki.
oh yeah that's right, i'll change that real quick
i forgot to test it