I’m currently trying to make an animated TV with changeable channels, the animation portion works but changing the channels does not. I’m using a value that can be changed from one to two, and then number cannot go past two. Output tells me nothing, and I’ve tried various different parts for it without succeeding. Here’s the script:
01 | local cd = script.Parent.ClickDetector |
02 | local screen = script.Parent.Parent.Screen |
03 | local pump = screen.Shotgun |
04 | local gui = screen.SurfaceGui |
05 | local image = gui.ImageLabel |
06 | local value = script.Parent.Parent.Channel.Value.Value |
07 | image.Visible = true |
08 |
09 | gui.Background.Visible = true |
10 | screen.Gunfire:Play() |
11 | screen.Music:Play() |
12 |
13 | while true do |
14 | wait() |
15 | if value = = 1 then |
16 | --Animation for channel 1 |
17 | else |
18 | if value = = 2 then |
19 | --Animation for channel 2 |
20 | end |
21 | end |
22 | end |
I tried doing “while value == 1 do” or “while value == 2 do” but that didn’t work.
Any help would be greatly appreciated, thanks!
Change local value = script.Parent.Parent.Channel.Value.Value
to
1 | local value = script.Parent.Parent.Channel.Value |
and then change the final code to this:
1 | while wait() do |
2 | if value.Value = = 1 then |
3 | --Animation for channel 1 |
4 | else |
5 | if value.Value = = 2 then |
6 | --Animation for channel 2 |
7 | end |
8 | end |
9 | end |