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

Need help with functions?

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

✓ Accepted answer

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

1 comment

0

Thanks! My game shall go on!

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