Advertisement
InTesting

Robloxian Clipboard (WIP)

Sep 25th, 2019
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.78 KB | None | 0 0
  1. print'Run Local'
  2. print'R = Clear clipboard.';
  3. print'E = Copy mode enabled/disabled.';print'F = Copy Text thats on the mouse.'
  4. print'More options coming soon.';
  5. print'Settings in script'
  6. print'https://pastebin.com/raw/U9BH33ar'
  7.  
  8. local Clear_Key = 'r'
  9. local Enable_Key = 'e'
  10. local Get_Text_Key = 'f'
  11. local Take_One_Text_Only = true
  12.  
  13. script.Name='Clipboard';wait();
  14. local players,Target_Gui_Objects,TB_Enabled=
  15.     game:service'Players',{'TextBox','TextButton','TextLabel'},false;
  16. local lp_1=players.LocalPlayer;
  17. local lp_2,mouse=players[lp_1.Name],lp_1:GetMouse();
  18. local pg=lp_2:FindFirstChildWhichIsA'PlayerGui'or(function()error'Can not find PlayerGui';
  19.     end)();
  20.  
  21. local function Get_UI()
  22.     local sg=pg:FindFirstChild'∞Clip'or(function()local a=Instance.new("ScreenGui",pg);
  23.         a.Name='∞Clip';a.ResetOnSpawn=true;return a;end)();
  24.     local tb=sg:FindFirstChildWhichIsA'TextBox'or(function()
  25.         local a=Instance.new("TextBox",sg);a.BackgroundColor3=Color3.new(0,0,0);
  26.         a.BorderColor3=Color3.new(1,1,1);a.Position=UDim2.new(0,0,.5,0);
  27.         a.Size=UDim2.new(.25,0,.5,0);a.Font='Code';a.Text='';
  28.         a.TextColor3=Color3.new(1,1,1);a.TextWrapped=true;a.ClearTextOnFocus=false;
  29.         a.TextXAlignment='Left';a.TextYAlignment='Top';a.TextScaled=false;
  30.         a.Text='Clipboard by SoftlockedUnderZero';
  31.         return a;end)();
  32.     tb:TweenPosition(UDim2.new(0,0,1,0));wait(1);
  33.    
  34.     local function Compare_Value_To_Table(v,t)
  35.         for _,c in pairs(t)do if c==v then return c;end;end;
  36.     end;
  37.     local function Check_For_Gui_Object(v)
  38.         if v then if v.Parent and Compare_Value_To_Table(v.ClassName,Target_Gui_Objects)then
  39.         if v.Parent~=sg then return v;end;end;end;
  40.     end;
  41.     local function Mouse_Is_In_Obj(ob)
  42.         local mx,my,abs_size,abs_pos=
  43.             mouse.X,mouse.Y,ob.AbsoluteSize,ob.AbsolutePosition;
  44.         local size_x,size_y,pos_x,pos_y=abs_size.X,abs_size.Y,abs_pos.X,abs_pos.Y;
  45.         local range_x_min,range_x_max,range_y_min,range_y_max=
  46.             pos_x,pos_x+size_x,pos_y,pos_y+size_y;
  47.         if range_x_min<mx and range_x_max>mx and range_y_min<my and range_y_max>my then
  48.             return ob;
  49.         end;
  50.     end;
  51.     local function Check_UIs()
  52.         for _,obj in pairs(pg:GetDescendants())do
  53.         if Check_For_Gui_Object(obj)and TB_Enabled then if Mouse_Is_In_Obj(obj)then
  54.         tb.Text=tb.Text..obj.Text;
  55.             if Take_One_Text_Only then
  56.                 break;end;end;end;
  57.         end;
  58.     end;
  59.    
  60.     local function On_KeyDown(key)
  61.         if key==Clear_Key and TB_Enabled then
  62.             tb.Text='Clipboard by SoftlockedUnderZero';
  63.             tb:TweenPosition(UDim2.new(0,0,1,0));TB_Enabled=false;wait(1);
  64.         elseif key==Enable_Key then TB_Enabled=not TB_Enabled;if TB_Enabled then
  65.             tb:TweenPosition(UDim2.new(0,0,.5,0));else
  66.             tb:TweenPosition(UDim2.new(0,0,1,0));end;wait(1);
  67.         elseif key==Get_Text_Key and TB_Enabled then Check_UIs();
  68.         end;
  69.     end;
  70.    
  71.     mouse.KeyDown:Connect(On_KeyDown)
  72. end;wait();Get_UI();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement