So I’m trying to code a script to check what the player is clicking. The problem is that whenever I click something it chooses a random object from workspace instead of what I am actually clicking. (sometimes its the right object by chance). I’m a little confused as to what I’m doing wrong.
I’m pretty new to this so be gentle, I’ve been teaching myself.
After clicking one of the red nodes that are within the Nodes group, I got this output. Btw I’m clicking a few times just in case.
Here’s the code, it’s a localscript being injected into the player when they join.
I’ve been doing some testing with it so obviously ignore the commented out areas and the function below.
It’s one of the learning curves to scripting…
When referencing a variable with another variable it docent call the value of the variable it just assigns the new variable the value of the original one
Example:
local Original = 2
local New = Original
Original = 4
print(New)
This would print out 2 because you are just assigning value, there is no reason that it would update to the new value of 4