repeat wait() until game.Players.LocalPlayer.Character
local RequiredWins = {
[1] = 4;
[2] = 10;
[3] = 25;
[4] = 100;
[5] = 250;
[6] = 500;
[7] = 1500;
[8] = 3500;
[9] = 6500;
[10] = 12000;
[11] = 25000;
[12] = 50000;
[13] = 100000;
[14] = 250000;
[15] = 500000;
[16] = 1000000;
[17] = 3000000;
[18] = 8000000;
[19] = 16000000;
[20] = 50000000;
[21] = 100000000;
[22] = 300000000;
[23] = 750000000;
[24] = 1500000000;
[25] = 10000000000;
[26] = 100000000000;
[27] = 500000000000;
[28] = 2000000000000;
[29] = 10000000000000;
[30] = 100000000000000;
[31] = 500000000000000;
[32] = 800000000000000000;
[33] = 500000000000000000000;
[34] = 10000000000000000000000;
}
function Check_And_Function()
local Player = game.Players.LocalPlayer
local Wins = Player.leaderstats.Wins
for i,v in pairs(workspace.Stages:GetChildren()) do
if Wins.Value >= RequiredWins[i] then
for i,r in pairs(v.WinsRequired:GetChildren()) do
if r:IsA("BasePart") then
r.CanCollide = false
r.Transparency = 1
end
end
else
for i,r in pairs(v.WinsRequired:GetChildren()) do
if r:IsA("BasePart") then
r.CanCollide = true
r.Transparency = .65
end
end
end
end
end
while wait(.5) do
Check_And_Function()
end
2 Likes
Please use a bit more description, like what you expect to happen and what does happen (just like the sample post for scripting support suggests) since we can’t read your mind about what should be happening. We also can’t tell anything from the picture.
Try printing the values like this in your section of code to see what the values actually are:
for i,v in pairs(workspace.Stages:GetChildren()) do
print("is ", Wins.Value," >= ", RequiredWins[i], "?")
if Wins.Value >= RequiredWins[i] then