Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(.2)
- plr = game.Players.LocalPlayer;
- plrgui = plr:WaitForChild('PlayerGui');
- screengui = plrgui:WaitForChild('ScreenGui');
- frame = screengui:WaitForChild('Frame');
- input = frame:WaitForChild('TextBox');
- answer = frame:WaitForChild('TextLabel');
- check = frame:WaitForChild('TextButton');
- print('uis loaded');
- debounce = false;
- squares = {};
- other = {};
- for i = 2,2000 do
- table.insert(squares,i*i);
- end;
- check.MouseButton1Click:connect(function()
- if debounce == false then
- debounce = true;
- perfect = false;
- local val = tonumber(input.Text);
- for i = 1,1999 do
- if val == squares[i] then
- perfect = true;
- answer:TweenSize(UDim2.new(0,200,0,0),'Out','Bounce',1,false);
- wait(1);
- answer:TweenSize(UDim2.new(0,200,0,50),'Out','Bounce',1,false);
- answer.Text = val^.5;
- break;
- elseif val%squares[i] == 0 then
- table.insert(other,squares[i]);
- end;
- end;
- print(perfect);
- if #other == 0 and perfect == false then
- answer:TweenSize(UDim2.new(0,200,0,0),'Out','Bounce',1,false);
- wait(1);
- answer:TweenSize(UDim2.new(0,200,0,50),'Out','Bounce',1,false);
- answer.Text = 'Already Simplified';
- elseif perfect == false then
- table.sort(other);
- big = (other[#other]);
- out = (other[#other])^.5;
- inside = val/big;
- print(inside);
- answer:TweenSize(UDim2.new(0,200,0,0),'Out','Bounce',1,false);
- wait(1);
- answer:TweenSize(UDim2.new(0,200,0,50),'Out','Bounce',1,false);
- answer.Text = (out..'√'..inside);
- end;
- end;
- debounce = false;
- end);
- --test
Advertisement
Add Comment
Please, Sign In to add comment