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

Please fix this script. What is wrong with it?

Asked by 9 years ago
if game.Workspace.Tardis.Inside.Fuse.Value = true then 
game.Workspace.Tardis.Inside.ScreenPanel.Screen.SurfaceGui.Enabled = true
else
game.Workspace.Tardis.Inside.ScreenPanel.Screen.SurfaceGui.Enabled = false
end

0
Just edited to code block iDoctorW 0 — 9y

3 answers

Log in to vote
-1
Answered by 9 years ago

I don't know, but what will help is if you did this in code block so you don't ruin your rep. Plus it might ruin others as well.

Ad
Log in to vote
2
Answered by
Redbullusa 1580 Moderation Voter
9 years ago

Replace '=' to '=='.

'=' Means you're going to assign it to something.

'==' Means it is equivalent to something.

Give a substantial description and what goal your script is trying to reach next time, so we would know what you're trying to do. :)

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

In your if statement on line 1, add an extra equal sign.

= - This means you are defining / setting something.

== - This is comparing something.

Since you're comparing whether or not Fuse's Value is true you want two equal signs.

if game.Workspace.Tardis.Inside.Fuse.Value == true then 
game.Workspace.Tardis.Inside.ScreenPanel.Screen.SurfaceGui.Enabled = true
else
game.Workspace.Tardis.Inside.ScreenPanel.Screen.SurfaceGui.Enabled = false
end

Also I suggest setting some variables.

Answer this question