Hii, I have this minigame where the player has to sort files from A-Z, but I’m not sure how to go about scripting it.
repeat task.wait() until game:IsLoaded()
local RS = game:GetService("ReplicatedStorage")
local filetask = RS.FileTask
local player = game.Players.LocalPlayer
local filed = script.Parent.Files
local FileNames = {}
local PossibleNames = {
"Joy",
"Love",
"Peace",
"Serenity",
"Mind",
"BrainTech",
"Aid",
"Anatomy",
"Happiness",
"Identity",
"Radio",
"Music",
}
function checktext()
--check if folder1-5 are in ABC order
end
for i, button in ipairs(filed:GetChildren()) do
button.MouseButton1Click:Connect(function()
if button.Name ~= "Folder1" then
local folder1text = filed.Folder1.TextLabel.Text
local folder2text = filed.Folder2.TextLabel.Text
local folder3text = filed.Folder3.TextLabel.Text
local folder4text = filed.Folder4.TextLabel.Text
local folder5text = filed.Folder5.TextLabel.Text
--rearrange folder text, button pressed goes to the top, the rest shift down
checktext()
end
end)
end
function generatefilenames()
while 5 do
local randomentry = PossibleNames[math.random(1, #PossibleNames)]
--check if randomentry doesnt equal anything in FileNames
table.insert(FileNames, randomentry)
end
end
filetask.OnClientEvent:Connect(function(desk)
script.Parent.Enabled = true
end)
The comments written are where I don’t know what to do
