I’m creating a game, and for a TV, I want to have a random video chooser, but my problem is, I don’t know how to script, and I can’t find any videos on it, how would you do it?
Well, provided you already have the Video Objects what you could do is put them inside a Folder, then call GetChildren()
which would return back a table of all the Videos inside that Folder
Next you can use math.random()
which would randomly choose 1 of the Videos out of the Video Folder
I don’t know much about how Videos work, but I’m assuming that they have some sort of .Ended
Event that detects when the current timelapse of the video has ended
You can put it through a while true do
loop, repeating infinitely:
local Videos = workspace.Videos:GetChildren() --"Videos" is referenced as a folder
while true do
local RandomVideo = Videos[math.random(1, #Videos)]
if RandomVideo then
RandomVideo:Play()
RandomVideo.Ended:Wait()
end
end