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

how to make a wall that you can walk through when you have 1000 currencies?

Asked by 3 years ago

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

0
Use a local script to set the propertie cancolide to fasle or just delete the part Dragon_meck 15 — 3y
0
also use if statement to see if they have over 1000 currency Dragon_meck 15 — 3y
0
Have the Server set a falsy CollisionGroup when their currency reaches 1k. Ziffixture 6913 — 3y

2 answers

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago

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
0
If you want to make a script, its harder and its server sided. Everyone can pass through instead of just him. Xapelize 2658 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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.

Answer this question