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

Conditional Statement,not working?

Asked by 10 years ago

Its seems that line 30 and 39 won't work,It keeps making the R$ label's text show null and the Tix label won't change,but if I remove those lines it works properly.

The model is here http://www.roblox.com/item.aspx?seoname=Help&id=159979067

NameOfProduct = 159913543
Item = game:GetService("MarketplaceService"):GetProductInfo(NameOfProduct)-- Gets the service Markplace
part = script.Parent
Product = script.Parent.Parent.product
clicked = false
part.MouseButton1Click:connect(function()
---------------Debounce------------------
 if clicked == false--Checks if clicked is false(Which it should be,because it already been set false)
    then 
    clicked = true-- Since it false it will turn it true(so we know it's already been clicked)

----------------Fade Out------------------
    for fo = 0,10 do
        wait(0.1)
        part.BackgroundTransparency = fo/10--You need to divide to get the precise number(Other way won't work)
        part.TextTransparency = fo/10
        if fo/10 ==1
            then
            part.Visible = false
            clicked = false --Turns it false,so it you won't able to click it.
         Product.Visible = true
--------------The frame--------------------
 Product:TweenSize(UDim2.new(0, 700,0, 500),"Out","Sine",1,true)--The animation
-------------MarketPlace Service-----------
Product.ProductImage.Thumbnail.Image = "http://www.roblox.com/Game/Tools/ThumbnailAsset.ashx?aid="..NameOfProduct.."&fmt=png&wd=420&ht=420"--Gets the thumbnail of the product
Product.ProductName.Text = Item.Name--Gets name of item
Product.ProductDescription.Text = "Description"..": "..Item.Description--Gets Description of item
Product.ProductRobux.Text = Item.PriceInRobux--Gets the price of Robux
------------Removes Nulls-----------------
if Product.ProductRobux.Text == null -- No one likes them
    then
    Product.ProductRobux.Visible = false
elseif Product.ProductRobux.Text == null
    then
    Product.ProductRobux.Visible = true
-------------------------------------------
Product.ProductTix.Text = Item.PriceInTickets--Gets the price of tix
------------Removes Nulls-----------------
if Product.ProductTix.Text == null
    then
    Product.ProductTix.Visible = false
elseif Product.ProductTix.Text == null
    then
    Product.ProductTix.Visible = true

-----------------------------------------
end
end

        end
        end 
end


end)
0
By null, do you mean nil (Doesn't exist) or "" nothing is in there Shawnyg 4330 — 10y
0
The Textlabel's text just shows null kevinnight45 550 — 10y
2
Their text? so isn't supposed to be `if Prodcut.blahblahblah == "null"` for their text? Since it's not a numerical value Shawnyg 4330 — 10y
0
Thanks. kevinnight45 550 — 10y
0
Ok,now it won't show the price in tickets kevinnight45 550 — 10y

Answer this question