I want to acieve a way to look for a model (with any name) in a folder. I just don’t know how to do it. Can you guys help?
game.ReplicatedStorage.Game.OnPlayerSurvived.OnServerEvent:Connect(function(player, argument)
if game.Workspace.Multiplayer.Map.Settings.Difficulty.Value == 1 then
player.leaderstats.Asteroids.Value += math.random(1,5)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 2 then
player.leaderstats.Asteroids.Value += math.random(3,10)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 3 then
player.leaderstats.Asteroids.Value += math.random(6,15)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 4 then
player.leaderstats.Asteroids.Value += math.random(15,35)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 5 then
player.leaderstats.Asteroids.Value += math.random(25,50)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 6 then
player.leaderstats.Asteroids.Value += math.random(35,80)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 7 then
player.leaderstats.Asteroids.Value += math.random(75,135)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 8 then
player.leaderstats.Asteroids.Value += math.random(150,180)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 9 then
player.leaderstats.Asteroids.Value += math.random(200,265)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 10 then
player.leaderstats.Asteroids.Value += math.random(250,315)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 11 then
player.leaderstats.Asteroids.Value += math.random(335,450)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 12 then
player.leaderstats.Asteroids.Value += math.random(475,665)
elseif game.Workspace.Multiplayer.Settings.Difficulty.Value == 13 then
player.leaderstats.Asteroids.Value += math.random(675,750)
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.