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

Why won't elseif then work?*Fixed*

Asked by 11 years ago

Line24 works perfectly,but line 33 won't work and their almost the same it also won't print,why?

Line24:

1if frame.RCurrency.Text == "null"
2    then
3    Disappear(frame.RCurrency)
4    Disappear(frame.RLabel)
5 
6else
7    Appear(frame.RCurrency)
8    Appear(frame.RLabel)

Line33:

1if frame.TCurrency == "null"
2    then
3    print("Null")
4    Disapear(frame.TCurrency)
5    Disapear(frame.TLabel)
6else
7    print("Not Null")
8    Appear(frame.TCurrency)
9    Appear(frame.TLabel)

The whole code is here:

01frame = script.Parent
02----Functions-----------
03function Appear(name)
04name.Visible = true
05end
06function Disappear(name)
07    name.Visible = false
08end
09 function ChangeText(name,txt)
10    name.Text = txt
11end
12----Product stuff-------
13Id = {158717210}
14thumbnail = "http://www.roblox.com/Game/Tools/ThumbnailAsset.ashx?aid="..Id[1].."&fmt=png&wd=420&ht=420"
15Item = game:GetService("MarketplaceService"):GetProductInfo(Id[1])
View all 43 lines...
0
Fixed it try again HexC3D 830 — 11y
0
It didn't work.If you need the model its here http://www.roblox.com/help-item?id=160115175 kevinnight45 550 — 11y
0
Try again, sorry for the trouble. HexC3D 830 — 11y
0
It's ok I fixed it kevinnight45 550 — 11y

2 answers

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
11 years ago

Line 39

"else if" that's what you said. even though you added the space

Correction: Try:

"else"

Difference was the space between, we all make typos, Next time double check :) Also you can do else too.

Example :

01if frame.RCurrency.Text == "null"
02        then
03        Disappear(frame.RLabel)
04     Disappear(frame.RCurrency)
05    else
06        Appear(frame.RCurrency)
07        Appear(frame.RLabel)
08end
09    -------------------------
10    if frame.TCurrency == "null"
11        then
12        print("Null")
13        Disapear(frame.TCurrency)
14    Disapear(frame.TLabel)
15    else
16        print("Not Null")
17        Appear(frame.TCurrency)
18        Appear(frame.TLabel)
19        end

if this helped +1

0
Still didn't work. kevinnight45 550 — 11y
Ad
Log in to vote
1
Answered by 11 years ago

It's elseif not else if and it's like

1elseif --[[stuff]] then

not

1elseif --[[stuff]]--
2then
0
@Below, I said the same thing... -_- Roboy5857 20 — 11y

Answer this question