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

Need help with functions?

Asked by 9 years ago

Ok so Here is a working script

local NintendoToSega = game.Players.LocalPlayer.PlayerGui.ChooseCharacter.NintendoToSega

function onClick4()
if NintendoToSega.Visible
then NintendoToSega.Visible = false
end
end

button.MouseButton1Click:connect(onClick4)

I need to know A way to write it If it is not visible it will be visible because I have tried

local SegaToNintendo = game.Players.LocalPlayer.PlayerGui.ChooseCharacter.SegaToNintendo

function onClick5()
if SegaToNintendo.Visible = false
then SegaToNintendo.Visible
end
end

button.MouseButton1Click(onClick5)

And Then there is a red line under = for "= false" Please Help

1 answer

Log in to vote
1
Answered by
DataStore 530 Moderation Voter
9 years ago

If you hover your mouse over the segment with a squiggly line it will tell you what's wrong with it, alternatively look at the "Script Analysis" window.

You need to use "==" when comparing values, so you would do:

if SegaToNintendo.Visible == false then

Alternatively, you could use the "not" operator.

if not SegaToNintendo.Visible then

http://wiki.roblox.com/index.php?title=Not_operator#Not

0
Thanks! My game shall go on! ILikepie2100 20 — 9y
Ad

Answer this question