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

Why won't the GUI Tweening in my script work? say's it's not valid member

Asked by 7 years ago

It says In and Out isn't a valid member of Udim2

Here is my script:

local suf = script.Parent
local wea = math.random(1,3)
-- cloudy img id (http://www.roblox.com/asset/?id=247421728)
-- sunny img id (http://www.roblox.com/asset/?id=240651660)
--rainy img id (http://www.roblox.com/asset/?id=261307190)
-- all frames position should be {0, 0},{0.017, 0}
repeat wait() until suf and wea

function miv()
    suf:TweenPosition(UDim2.new( 0 , 0 ,  0.017 ,  0 ) "In" "Quad" , 1)
     if suf:TweenPosition() == suf:TweenPosition(UDim2.new(0,0,0.017,0)) then
        wait(10)
        suf:TweenPosition(UDim2.new( -0.2 , 0 ,  0.017 ,  0 ) "Out" "Quad" , 1)
    end
end

function weahter()
 suf.BackgroundTransparency = 1  
  suf.ImageLabel.BackgroundTransparency =1
 suf.TextLabel.BackgroundTransparency =1

if  suf.BackgroundTransparency == 1 and  suf.ImageLabel.BackgroundTransparency ==1 and suf.TextLabel.BackgroundTransparency ==1 then
suf.BackgroundTransparency = 0 
  suf.ImageLabel.BackgroundTransparency = 0
 suf.TextLabel.BackgroundTransparency = 0
    if wea == 1 then -- if its sunny
        suf.ImageLabel.Image = "http://www.roblox.com/asset/?id=240651660"
            suf.TextLabel.Text = "It will be sunny today"
    end

    if wea == 2 then -- if its rainy
        suf.ImageLabel.Image = "http://www.roblox.com/asset/?id=261307190"
        suf.TextLabel.Text = "It will be rainy today"
    end

    if wea == 3 then -- if its cloudy
        suf.ImageLabel.Image = "http://www.roblox.com/asset/?id=247421728"
        suf.TextLabel.Text = "It will be cloudy today"
    end
end
end

weahter()


suf.Parent.TextButton.MouseButton1Click:connect(miv)
suf.Parent.TextButton.MouseButton1Click:connect(weahter)

1 answer

Log in to vote
0
Answered by 7 years ago

The EasingDirection and EasingStyle is two separate arguments, so you need commas. For example,

suf:TweenPosition(UDim2.new( 0 , 0 ,  0.017 ,  0 ), "In", "Quad" , 1)

Also, the parent of the script and math.random's return value will probably never be nil.

Hope this helps!

0
I don't get what you mean by the last statement. Isn't the vlaue not supposed to be nil? TheLightningRises 56 — 7y
0
You forgot the commas to separate the arguments. hiimgoodpack 2009 — 7y
Ad

Answer this question