while true do
local repstorage = game:GetService("ReplicatedStorage")
wait(10) -- just the testing num
local part = repstorage.DFStuff.MaguMagu:Clone()-- Change "Part" to the part name.
part.Parent = game.Workspace
print('fruit spawned') -- will be removed
end
✓ ANSWER ACCEPTED
Choose random from this folder???
1 answer
✓ Accepted answer
Here is one way to randomly choose an item:
local DFChildren = repstorage.DFStuff:GetChildren() -- Returns a table
local random = DFChildren[math.random(1, #DFChildren)]
Line 2 uses math.random() to iterate through the table and grab a random index.
This discussion is preserved as it was. New answers, comments, and votes are closed.
