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

Why won't the script function as I would like it to? (Script in body)

Asked by 10 years ago

It says to include code 'snipits', but this is a short script so I will include the whole thing, as well as an explanation of what I am trying to do.

wait(60)
game.StarterGui.Purgetime.TextButton.Script.Disabled = false
game.StarterGui.Waittime.TextButton.Script.Disabled = true
if true then
wait(720)
game.StarterGui.Purgetime.TextButton.Script.Disabled = true
game.StarterGui.Waittime.TextButton.Script.Disabled = false
end

Basically, I am creating a game based off of the movie "The Purge"

What I am trying to do, as you might be able to see is turn the timer script in the GUIs I have off/on at intervals. The Waittime GUI is where the players will wait in the lobby, then when the Waittime GUI is disabled, and the Purgetime GUI is enabled different timers will be active/inactive. My goal is to have an interval where one Script is active while the other is not, wait a certain amount of time, then make the inactive script active, and the active script inactive.

The problem: Nothing is happening when I run the game. Both scripts still run normally, without being activated or deactivated. Thanks!

===========Note: I would also like the script to loop, but I am not sure how..==========

1 answer

Log in to vote
0
Answered by
Tesouro 407 Moderation Voter
10 years ago

You didn't put what the if statement is checking. Just

if true then

won't work. If you want one of these Disabled properties to be checked, you have to insert them in the if line. Like this:

if game.StarterGui.Purgetime.TextButton.Script.Disabled == true then

Or this:

if game.StarterGui.Waittime.TextButton.Script.Disabled == true then

But beyond that, I didn't understand what you mean, sorry.

1
Thank you so much! That fixed it! You're amazing! nightmare13542 45 — 10y
0
Thank you, I'm glad I helped. Tesouro 407 — 10y
Ad

Answer this question