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

Demo script writing [closed]

Asked by 10 years ago

I wrote this by self without looking at any other source. When you click a TextButton its Parent will grow. Did I code right? Did I miss something out? Did I completyl muss up.

local Frame = script.Parent.Parent

function Run(OnClicked)
    Frame:Tweensize(0.5,0 0.5,0) ,"In","Quad","20","true"
end

Run(Hit1Button1)

Closed as Not Constructive by User#2

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
6
Answered by 10 years ago

Yes you did mess up.

local Frame = script.Parent.Parent
local TB = Frame.TextButton -- get the text button from the frame

function Click()
    Frame:TweenSize(UDim2.new(0.5,0,0.5,0),"In","Quad",20,true)
end

TB.MouseButton1Click:connect(Click) -- now when the text button gets clicked on it will activate the Click() function
Ad