|
| 14 Aug 2011 02:49 PM |
i know this plugin works but it needs a close button can anyone help?
self = PluginManager():CreatePlugin()
toolbar = self:CreateToolbar("Peronsal Plugins") toolbarbutton = toolbar:CreateButton("", "Its a Stopwatch","Time2.png") time = 0 doing = false
function GuiMaker(text, name, position, size, textcolor, font, type, par, fontfam) local gui = Instance.new(type, par) gui.Name = name gui.Position = position gui.Size = size gui.TextColor3 = textcolor gui.FontSize = font gui.Text = text gui.Font = fontfam return gui end
function onClickedStart() if doing then return end doing = true time = 0 while doing == true do time = time + 1 game.CoreGui.Stopwatch.Frame.Amount.Text = "Time: " .. time wait(1) end end
function onClickedStop() if doing == false then return end doing = false end
toolbarbutton.Click:connect(function() local gui = Instance.new("ScreenGui", game.CoreGui) gui.Name = "Stopwatch" local frame = Instance.new("Frame", gui) frame.Size = UDim2.new(0, 500, 0, 200) frame.Position = UDim2.new(0.5, -50, 0, 0) frame.Style = "ChatBlue" local amount = GuiMaker("Time: 0", "Amount", UDim2.new(0, -8, 0, 0), UDim2.new(0, 480, 0, 75), Color3.new(1, 1, 1), "Size24", "TextLabel", frame, "ArialBold") amount.BackgroundTransparency = 1 local start = GuiMaker("Start", "Start", UDim2.new(0, 0, 1, -50), UDim2.new(0, 100, 0, 50), Color3.new(1, 1, 1), "Size24", "TextButton", frame, "ArialBold") start.Style = "RobloxButtonDefault" local stop = GuiMaker("Stop", "Stop", UDim2.new(1, -100, 1, -50), UDim2.new(0, 100, 0, 50), Color3.new(1, 1, 1), "Size24", "TextButton", frame, "ArialBold") stop.Style = "RobloxButtonDefault" start.MouseButton1Click:connect(onClickedStart) stop.MouseButton1Click:connect(onClickedStop) end)
|
|
|
| Report Abuse |
|
| |