How can I prevent this script from choosing the same floor twice?
function ChooseFloor()
local Floors = game.ReplicatedStorage.Floors:GetChildren()
local PickFloor = math.random(1, #Floors)
local SelectedFloor = Floors[PickFloor]:Clone()
SelectedFloor.Name = "Floor"
SelectedFloor.Parent = game.Workspace
end

8 comments
I get this error: ServerScriptService.ElevatorScript:85: attempt to index local 'PickFloor' (a number value)
Can you post the whole script so I can see in what line the script errors?
It's line 4
Change string.find to string.match
k
Doesn't work still (same error)
I would suggest to put a boolean value into each floor and change it to true at the end of the function and check if it is true at the begin of the function.
Could you script that into an answer? I'm not sure how to..