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

Why won't elseif then work?*Fixed*

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



4 comments

0

Fixed it try again

0

It didn't work.If you need the model its here http://www.roblox.com/help-item?id=160115175

0

Try again, sorry for the trouble.

0

It's ok I fixed it

2 answers

✓ Accepted answer

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

1 comment

0

Still didn't work.

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

elseif --[[stuff]] then

not

elseif --[[stuff]]-- 
then

1 comment

0

@Below, I said the same thing... -_-

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