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 10 years ago

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

Line24:

if frame.RCurrency.Text == "null" 
    then
    Disappear(frame.RCurrency)
    Disappear(frame.RLabel)

else
    Appear(frame.RCurrency)
    Appear(frame.RLabel)

Line33:

if frame.TCurrency == "null"
    then
    print("Null")
    Disapear(frame.TCurrency)
    Disapear(frame.TLabel)
else
    print("Not Null")
    Appear(frame.TCurrency)
    Appear(frame.TLabel)

The whole code is here:

frame = script.Parent
----Functions-----------
function Appear(name)
name.Visible = true
end
function Disappear(name)
    name.Visible = false
end
 function ChangeText(name,txt)
    name.Text = txt
end
----Product stuff-------
Id = {158717210}
thumbnail = "http://www.roblox.com/Game/Tools/ThumbnailAsset.ashx?aid="..Id[1].."&fmt=png&wd=420&ht=420"
Item = game:GetService("MarketplaceService"):GetProductInfo(Id[1])
----Changing Text-------
ChangeText(frame.ProductName,Item.Name)
ChangeText(frame.ProductDescription,Item.Description)
ChangeText(frame.RCurrency,Item.PriceInRobux)
ChangeText(frame.TCurrency,Item.PriceInTickets)
----Thumbnail-----------
frame.ProductImage.Thumbnail.Image = thumbnail
----RemoveNulls--------
if frame.RCurrency.Text == "null" 
    then
    Disappear(frame.RCurrency)
    Disappear(frame.RLabel)

else
    Appear(frame.RCurrency)
    Appear(frame.RLabel)
-------------------------
if frame.TCurrency == "null"
    then
    print("Null")
    Disapear(frame.TCurrency)
    Disapear(frame.TLabel)
else
    print("Not Null")
    Appear(frame.TCurrency)
    Appear(frame.TLabel)
        end
end



0
Fixed it try again HexC3D 830 — 10y
0
It didn't work.If you need the model its here http://www.roblox.com/help-item?id=160115175 kevinnight45 550 — 10y
0
Try again, sorry for the trouble. HexC3D 830 — 10y
0
It's ok I fixed it kevinnight45 550 — 10y

2 answers

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 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 :

if frame.RCurrency.Text == "null"
        then
        Disappear(frame.RLabel)
     Disappear(frame.RCurrency)
    else
        Appear(frame.RCurrency)
        Appear(frame.RLabel)
end
    -------------------------
    if frame.TCurrency == "null"
        then
        print("Null")
        Disapear(frame.TCurrency)
    Disapear(frame.TLabel)
    else
        print("Not Null")
        Appear(frame.TCurrency)
        Appear(frame.TLabel)
        end


if this helped +1

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

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

elseif --[[stuff]] then

not

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

Answer this question