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

How do i make a door which you can only pass at a certain amount of "Coins"?

Asked by 2 years ago

I'm developing a game where you beat an obby and gain leaderstats named Coins. After a certain amount of Coins you are able to go to another room with harder difficulties. I've made the leaderstats as well as the data store to save the leaderstats but i cant figure out how to do this thing. I want to make it so you if you have 50 coins or more you can enter through a door which is normally not enterable.

0
I have to see what manages the coin value Roblox28721 10 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

Try:

local door = game.workspace.Door

local player = game.Player.LocalPlayer
local CoinValue = player.leaderstats.Coin

if CoinValue.Value >= 50 then
    door.Cancollide = false
    door.Transparency = 1
end
Ad

Answer this question