Here is the section of my code:
1 | local Player = game.Players.LocalPlayer |
2 | local Door = game.Workspace.Door 1 |
3 | local SetDistance = 10 |
4 | if (Door.Position - Player.Character.Head.Positon).Magnitude < SetDistance then |
I am inexperienced to magnitude so this is new, however it is refusing to print atleast once.
This is worspace>localscript
I don't like to use script helper unless if its a last resort, however I make stupid mistakes in my script that I cannt identify.
Is the localscript located in the workspace ? if it is then the localscript wont run
The only problem I noticed is that you misspelled Position, instead it was 'positon'.
1 | local Player = game.Players.LocalPlayer |
2 | local Door = game.Workspace.Door 1 |
3 | local SetDistance = 10 |
4 | if (Door.Position - Player.Character.Head.Position).Magnitude < SetDistance then |
5 | -- Do stuff |
6 | end |
Firstly the local script is in the workspace, local scripts do not function in the workspace
And secondly you did not tell it to print anything