I am trying to make a vending machine so when you click it you get a bloxy cola. but when i click it i get "not enough money" in the output even if i have 100 Schoolbux. (it's in a normal script)
Here is my code:
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if plr:WaitForChild("leaderstats").Schoolbux.Value >= 5 then
print("bought")
else
print("not enough money")
end
end)

4 comments
Is this a localscript?
Also can you show the whole script?
Its not a localScript
And thats the whole script