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

How to fix no variables in the "watch" tab and global variables cant be used in other scripts?

Asked by 1 year ago
Edited 1 year ago

Basically I want to use variables but its not easy because global variables dont work on all scripts only on the one it originated from.

--Script 1
_G.thing = "ball"
print(_G.thing)
--Output is "ball"

--Script 2
wait(1)
print(_G.thing)
--Output is "nil"

And in the "watch" tab no variables show up, none, not even local variables.

Image: http://cdn.discordapp.com/attachments/678245054451810304/1055115233464692766/image.png

if anyone knows how to fix these 2 problems please tell me, ive been trying to fix them for a while now, but roblox dev forum wont let me talk in there.

1 answer

Log in to vote
0
Answered by 1 year ago

I fixed it.

For the variables to show up in the Watch tab, I forgot to set a breakpoint.

And for the global variables, I called the variable wrong instead of _G.variable; I called it just variable.

For me, it took a few days to find the solutions to this; if anyone is having the same problem, feel free to use this.

Ad

Answer this question