Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local module = {};
- local methods = {};
- methods.__index = methods;
- function module.new(name, text)
- local newButton = {};
- newButton.Name = name;
- local ButtonInstance = Instance.new("TextButton");
- ButtonInstance.Text = text;
- newButton._btn = ButtonInstance;
- local Bind = Instance.new("BindableEvent");
- newButton.Clicked = Bind.Event;
- newButton._event = Bind;
- setmetatable(newButton, methods);
- ButtonInstance.MouseButton1Down:Connect(function() Bind:Fire();end);
- return ButtonInstance;
- end;
- function methods:Click()
- self._event:Fire();
- end;
- return module;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement