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

What am I doing wrong?

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

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!)

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