FIrst time I clicked with 0 coins it printed this
Then I gave myself 2000 coins from the Player<Unknown<leaderstats folder<Coins number value<2000
No output showing 2000
FIrst time I clicked with 0 coins it printed this
local click = script.Parent.ClickDetector
local doorOpened = false
local door = script.Parent
click.MouseClick:Connect(function(plr)
if doorOpened then return end
local coins = plr:WaitForChild("leaderstats"):WaitForChild("Coins")
if coins.Value >= 2000 then
coins.Value -= 2000
doorOpened = true
door.Transparency = 1
door.CanCollide = false
wait(3)
door.Transparency = 0
door.CanCollide = true
doorOpened = false
end
end)
Moved the doorOpened = true
line to after the coin deduction is made.
Nope did not work again idk why its not working
https://gyazo.com/735f82b9ad34277a6d97909557c0c61a
I tested everything myself, and it’s working for me.
Here is how everything is organised.
ohh could it be the problem with Unkown DN+
Possibly, I’d get rid of any currently broken scripts/plugins which you have in the game. I tried the script on a blank baseplate with a generic leaderstats script and it worked fine.
https://gyazo.com/9bb59704f08049fd2d0443f3b7ef9866
In the above I don’t have 2,000 coins and as such the purchase is not made.