How to make a wall through which you can go only if you have the right amount of currency (currency added every 5 seconds) (script) please because the youtube guides did not work for me
Make the player client (use LocalScript to access clients) collide false the 1k currency when they have 1k. Your script should look like this:
(LOCALSCRIPT)
if game.Players.LocalPlayer.leaderstats.Currency.Value = 1000 then script.Parent.CanCollide = false end
To extend on the previous answer, I'd suggest putting the LocalScript in something like StarterGui and putting this inside it:
game.Players.LocalPlayer.leaderstats.[Insert Currency Here].Value.Changed:connect(function() if game.Players.LocalPlayer.leaderstats.[Insert Currency Here].Value < 999 then game.Workspace.[Insert Door Name Here].CanCollide = false end end)
The previous script, on closer inspection, actually wouldn't work at all! First of all, they made a mistake when detecting if it was equal to 1000. They put "=" instead of "==". Secondly, they weren't supposed to detect if it was equal to it at all! They were supposed to detect if it was equal to or bigger than it. Thirdly, they forgot to put any form of trigger on it. So, the script would only detect it if the player only just joined the game, and no time during the actual gameplay. I've given you an (untested) script that fixes all of these. Please tell me if it works. If it doesn't, I can take a closer look at it.