Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Roblox - how to make when i click button tv program turn on?

How can I do that when I click this yellow button, the program will appear and the program's sound will start to play, and when I click the button again, the program will turn off and the program sound will stop playing and so on. The name of the TV is Old TV, the name of the sound is sound and the decal name of the program is TV Program.

photos : https://imgur.com/a/qNLG9r7

1 answer

I think that you should make two functions: one of them closes the tv and another turns it on. Then listen for the click and fire the turn on function. For the turn on function you play the sound, the image/decal and whatever else you want to do, and for the turn off function you just remove the other things or just move them to repstorage. Make sure to make a bool var which says if the tv is on or off, and when you press the button, add an if statement which determines which function to fire

2 comments

0

also make sure to switch the var when you fire the functions

0

and if you want another script to listen if the tv is on, then you need to make a boolean value

This discussion is preserved as it was. New answers, comments, and votes are closed.