Im working on a simple simulator and the module I use todo door functions isn’t allowing purchasing.
local module = {}
local Cost = {
DoorOne = 10000,
DoorTwo = 150000,
}
local DoorCodes = {
DoorOne = 1,
DoorTwo = 2,
}
function module.Purchase(player, Door)
local FindCost = Cost[Door]
local FindDoorCode = DoorCodes[Door]
local HiddenStats = player:WaitForChild("HiddenStats")
local leaderstats = player:WaitForChild("leaderstats")
local DoorsUnlocked = HiddenStats.DoorsUnlocked
if FindDoorCode > DoorsUnlocked.Value and leaderstats.Coins.Value >= FindCost then
DoorsUnlocked.Value = DoorCodes[Door]
print(DoorsUnlocked.Value)
end
end
return module