Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying to simply make a tv switching decals. Help?

Asked by 8 years ago

script:

local button = script.Parent
local tv = script.Parent.Parent.Screen
local hd = tv.HomeDepot
local mp = tv.MPMotors
local Kim = tv.Kimbo
local Xiv = tv.Xivics

local advertisements = {hd, mp, Kim, Xiv}

function television(onClick)    
while true do 
for i,v in pairs do

    end
end

This script belongs to the button that turns it on and there's another that turns it off. I just don't know how to plug the table into the for loop. Help?

1 answer

Log in to vote
1
Answered by 8 years ago
local button = script.Parent
local tv = script.Parent.Parent.Screen
local hd = tv.HomeDepot
local mp = tv.MPMotors
local Kim = tv.Kimbo
local Xiv = tv.Xivics

local advertisements = {hd, mp, Kim, Xiv}
local timeswitch = .5
function television(onClick)    
breaker = Instance.new("BoolValue")
breaker.Name = "Breaker"
breaker.Parent = tv
while true do 
wait()
for i,v in pairs(advertisements) do
v.Transparency = 0
wait(timeswitch)
v.Transparency = 1
    end
if breaker == nil then
break
end
end

You need to reference the table advertisements and so v would be the iterating correlating table number so that would be the decal in the table it's on atm so then just reference it with v! accept and +1 plox im nub if it works

Ad

Answer this question