`I’m trying to make a tv that every 5 seconds it will change the decal. Kind of like a fast food tv where it shows the menu and changes to show different part of the menu
Script while true do
script.Parent.Texture = “rbxassetid://7079865101”
wait(5)
script.Parent.Texture = “rbxassetid://7079865630”
wait(5)
script.Parent.Texture = “rbxassetid://7079879753”
wait(5)
script.Parent.Texture = “rbxassetid://7079888250”
wait(5)
script.Parent.Texture = “rbxassetid://7079901072”
wait(5)
end
Ohh, I hadn’t noticed. Was @Robbie11111112 wanting it to choose a specific thing from a list every 5 seconds or a random item from a list every 5 seconds?
while true do
while wait(5) do
script.Parent.Texture = “rbxassetid://7079865101”
while wait(5) do
script.Parent.Texture = “rbxassetid://7079865630”
while wait(5) do
script.Parent.Texture = “rbxassetid://7079888250”
while wait(5) do
script.Parent.Texture = “rbxassetid://7079901072”
end
end
end
end
end
local Table = {
'7079865101',
'7079865630',
'7079888250',
'7079901072'
}
while true do
for i = 1, #Table, 1 do
script.Parent.Texture = Table[i]
wait(5)
end
end
Basically @D0RYU’s script but slightly cleaner. By the way D0RYU, you should put the wait right before the loop ends, or else when the game starts the TV will be blank for 5 seconds.
local Table = {
'7079865101',
'7079865630',
'7079888250',
'7079901072',
}
while true do
for i,v in ipairs(Table) do
script.Parent.Texture = v;wait(5)
end
end
Recursion doesn’t add any benefits over a while loop, I don’t see why this would be necessary.
May I see an example of this? If it’s a while true do loop, it shouldn’t stop.
while loops shouldn’t make new threads either, it’s all synchronous. If you put a print() after the while loop, it shouldn’t print anything until after the loop has concluded
I don’t see why this would be necessary either. Precision is only required for vital aspects of a game, not on background objects.