local head = game.Workspace[player.Name].Head.Cframe.lookVector
local mouse = Cframe.new(game.Workspace[player.Name].Head.Position, mouse.Hit.p).lookVector
Here is the link to the video - https://www.youtube.com/watch?time_continue=3108&v=acJu605JNQE&feature=emb_logo
From what I understand
The head variable defines the lookVector of the head.
I am confused about the second part. First IDK what the p stand for - probably position.
I not sure but I've speculated that the mouse variable gets the Cframe of the mouse which is the extension of the head lookvector. However, the video shows the player being able to shoot in third-person, not first. So if the look vector of the head defines the mouse position then why is the avatar able to shoot in any direction without turning its head?
Why is the mouse.hit.P seperated with a comma, what does the comma do, is it the parent of the previous argument? If so why is it needed?

8 comments
Ok just judging from your script attempt there, you know pretty much nothing about scripting. This is a problem when it comes to learning from videos because you don't know to steer clear from AlvinBlox.
https://developer.roblox.com/en-us/quick-start#scripting
Once you get the basics, you'll need to learn a lot more before you can even understand how to make a gun system.
https://developer.roblox.com/en-us/articles/Raycasting , https://developer.roblox.com/en-us/articles/Understanding-CFrame , https://developer.roblox.com/en-us/api-reference/class/TweenService and maybe https://developer.roblox.com/en-us/articles/using-animations-in-games
@SteamG0D why would he steer clear from AlvinBlox?
@Nogalo, I cannot remember, so I may be wrong, but IIRC he never explained stuff.
I would recommend that you use SkeleDotLua's tutorial, cause AlvinBlox's tutorial is old and not good.
I read the whole WIKI basics, and some simple tutorial that I could understand, is that enough? I been at scripting for like a month.