Conditions being met, nothing happening

Ah okay.

So, when you put a print() inside of the if satement does it print anything? Try to pinpoint what in your system isn’t working exactly.

welp i fixed it i just defined pre values in the inventory table and check if they are 0 or not and its working great

Using global variables is considered bad practice and won’t deliver information too accurately. I too did this and learned my lesson. Here’s more information about it and the thread.

Using ModuleScripts is recommended and perhaps it might solve your problem.

EDIT: I see that the problem has already been fixed, but I would still steer away from global variables and not rely on them too much.

I only rely on them to use userdata thats literally all I use them for