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

What am I doing wrong?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
bin = game.StarterGui.MusicShopGui.MainFrame.ShopMain

function Clicked()
    bin.Visible = true
    wait(0.2)
bin(UDim2.new(0,0,0,1,0),"Out","Linear",1,true,nil)
end


MouseButton1Down:connect(Clicked)

I'm an armature at Lua, What is keeping this from working??

1 answer

Log in to vote
1
Answered by
Link43758 175
10 years ago
bin = game.StarterGui.MusicShopGui.MainFrame.ShopMain
bin.MouseButton1Down:connect(function()
    bin.Visible = true
    wait(0.2)
    bin:TweenPosition(UDim2.new(0,0,0,1,0),"Out","Linear",1,true,nil)
end)

I've changed just MouseButton1Down to bin.MouseButton1Down. (Without the bin, what would MouseButton1Down know what gui will fire the event?). I've also changed bin(UDim2.new(0,0,0,1,0),"Out","Linear",1,true,nil) to bin:TweenPosition(UDim2.new(0,0,0,1,0),"Out","Linear",1,true,nil) (Bin isn't a function!)

Ad

Answer this question