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

My magnitude refuses to print() when a certain magnitude is reached. Help?

Asked by 3 years ago

Here is the section of my code:

local Player = game.Players.LocalPlayer
local Door = game.Workspace.Door1
local SetDistance = 10
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.

0
Or its just properties, eitherway I need help. ifreakinlostmyacount 52 — 3y
0
could you show us more of the code raid6n 2196 — 3y
0
No, because thats all thats needed, its not a problem with the rest of the code. ifreakinlostmyacount 52 — 3y
0
because after this its suppose to "print", and its near the beginning where I list all of my possible variables. ifreakinlostmyacount 52 — 3y
0
there is no print greatneil80 2647 — 3y

3 answers

Log in to vote
2
Answered by 3 years ago

Is the localscript located in the workspace ? if it is then the localscript wont run

see this article

0
Oh sorry, your right, It was just properties, I usually code when I'm tired and make alot of mistakes. sorry for not upvoting your answer. ifreakinlostmyacount 52 — 3y
Ad
Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

The only problem I noticed is that you misspelled Position, instead it was 'positon'.

local Player = game.Players.LocalPlayer
local Door = game.Workspace.Door1
local SetDistance = 10
if (Door.Position - Player.Character.Head.Position).Magnitude < SetDistance then
    -- Do stuff
end
Log in to vote
0
Answered by 3 years ago

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

0
I did, I just felt like it wasn't important to leave in the segment of the script, because I said it was to print something. So their was no reason to. ifreakinlostmyacount 52 — 3y

Answer this question