In short, no local variables do not act like a local script. As long as the variable is inside of a server script, everyone will see what happens to the variable change, if you make it do something that people in the game can see.
A global variable has 1 value across the whole script. If you define it outside of a function or loop; just at the start of the script, you can only make changes one at a time.
X = 0
For i = 1,5 do
X =X + 1
end
print(X)
This will end up printing 5, as that is how the script is read. It goes through the for loop, and sets X as 5 after it is all done.
A local variable has different values depending where you reference it in the script. You can change the value in a loop, but the original value on the outside does not change.
local X = 0
For i = 1,5 do
local X = 0
X = X + 1
end
print(X)
Here, it will print 0, as the X inside the loop has no effect on the one outside of the loop. They are both their own variables, and for the most part don’t relate.
I hope this helped you understand!