ForeverDev

Untitled

Sep 5th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.88 KB | None | 0 0
  1. game.StarterGui:SetCoreGuiEnabled("All", false)
  2. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
  3. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
  4.  
  5. local assets = {
  6.     35636386, 72777962, 10715464, 169476802, 90512271,
  7.     126313419, 35660725
  8. }
  9.  
  10. for _, asset in pairs(assets) do
  11.     game:GetService("ContentProvider"):Preload("rbxassetid://" .. tostring(asset))
  12. end
  13.  
  14. local player = game.Players.LocalPlayer
  15. local mouse = player:GetMouse()
  16. repeat wait() until player.Character player.Character:Destroy()
  17. --player:WaitForDataReady()
  18.  
  19. local computer = {
  20.     screen = script.Parent
  21. }
  22.  
  23. function edit(obj, ...)
  24.     for _, property in pairs({...}) do
  25.         obj[property[1]] = property[2]
  26.     end
  27.     return obj
  28. end
  29.  
  30. function GLOBALinternetLoadHome(url)
  31.     internetLoadHome(url)
  32. end
  33.  
  34. function hookUpHoverEvents(object)
  35.     local position = object.Position
  36.     object.MouseEnter:connect(function()
  37.         object:TweenPosition(position - UDim2.new(0, 0, 0, 10), "Out", "Quad", 0.5)
  38.     end)
  39.     object.MouseLeave:connect(function()
  40.         coroutine.wrap(function()
  41.             repeat wait() until object.Position == position - UDim2.new(0, 0, 0, 10)
  42.             object:TweenPosition(position, "Out", "Bounce", 0.5)
  43.         end)()
  44.     end)
  45.     return function()
  46.         coroutine.wrap(function()
  47.             repeat wait() until object.Position == position - UDim2.new(0, 0, 0, 10)
  48.             object:TweenPosition(position, "Out", "Bounce", 0.5)
  49.         end)()
  50.     end
  51. end
  52.  
  53. function getSkin(type, ...)
  54.     local prop = ...
  55.     local skins = {
  56.         ["close_button"] = {
  57.             {"Size", UDim2.new(0, 20, 0, 20)},
  58.             {"Image", "rbxassetid://35636386"},
  59.             {"BackgroundTransparency", 1},
  60.             {"BorderSizePixel", 0}
  61.         },
  62.         ["blanket"] = {
  63.             {"Size", UDim2.new(1, 0, 1, 0)},
  64.             {"Text", ""},
  65.             {"BackgroundColor3", Color3.new(0, 0, 0)},
  66.             {"BorderSizePixel", 0}
  67.         },
  68.         ["icon"] = {
  69.             {"Size", UDim2.new(0, 50, 0, 50)},
  70.             {"BackgroundTransparency", 1},
  71.             {"BorderSizePixel", 0}
  72.         }
  73.     }
  74.     return unpack(skins[type])
  75. end
  76.  
  77. function generateUI()
  78.    
  79.     local background = edit(
  80.         Instance.new("ImageLabel", computer.screen),
  81.         {"Size", UDim2.new(1, 0, 1, 0)},
  82.         {"Image", "rbxassetid://10715464"}
  83.     )
  84.    
  85.     local currentIndex = 2
  86.    
  87.     local internetPage = edit(
  88.         Instance.new("Frame", computer.screen),
  89.         {"Position", UDim2.new(0, 0, -1, 0)},
  90.         {"Size", UDim2.new(1, 0, 1, 0)},
  91.         {"BackgroundColor3", Color3.new(0.3, 0.3, 0.3)},
  92.         {"ZIndex", currentIndex}
  93.     )
  94.    
  95.     local internetWebsiteDisplay = edit(
  96.         Instance.new("Frame", internetPage),
  97.         {"Size", UDim2.new(1, 0, 0.89, 0)},
  98.         {"Position", UDim2.new(0, 0, 0.11, 0)},
  99.         {"ZIndex", currentIndex}
  100.     )
  101.    
  102.     local internetSearchBar = edit(
  103.         Instance.new("TextBox", internetPage),
  104.         {"Size", UDim2.new(1, -100, 0, 25)},
  105.         {"Position", UDim2.new(0, 50, 0, 10)},
  106.         {"Text", "Default homepage"},
  107.         {"BackgroundColor3", Color3.new(1, 1, 1)},
  108.         {"FontSize", Enum.FontSize.Size14},
  109.         {"ZIndex", currentIndex}
  110.     )
  111.    
  112.     local internetSearchHistory = {}
  113.    
  114.     local slideHistory = function(url)
  115.         pcall(function()
  116.             for i = 9, 2, -1 do
  117.                 internetSearchHistory[i] = internetSearchHistory[i - 1]
  118.             end
  119.             internetSearchHistory[1] = url
  120.         end)
  121.     end
  122.    
  123.     local internetSearch = function(url)
  124.         internetWebsiteDisplay:ClearAllChildren()
  125.         slideHistory(url)
  126.         if url:find("google.com") then
  127.             print("google")
  128.         elseif url:find("roblox.com") then
  129.             local playerImage = edit(
  130.                 Instance.new("ImageLabel", internetWebsiteDisplay),
  131.                 {"Size", UDim2.new(0, 150, 0, 150)},
  132.                 {"Image", "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=" .. player.Name},
  133.                 {"Position", UDim2.new(0.5, -75, 0, 10)},
  134.                 {"ZIndex", currentIndex}
  135.             )
  136.            
  137.             local robloxLogo = edit(
  138.                 Instance.new("ImageLabel", internetWebsiteDisplay),
  139.                 {"Size", UDim2.new(0, 100, 0, 100)},
  140.                 {"Image", "rbxassetid://126313419"},
  141.                 {"Position", UDim2.new(0, 10, 0, 10)},
  142.                 {"ZIndex", currentIndex}
  143.             )
  144.         else
  145.             local notFound = edit(
  146.                 Instance.new("TextLabel", internetWebsiteDisplay),
  147.                 {"Size", UDim2.new(0, 350, 0, 75)},
  148.                 {"Position", UDim2.new(0.5, -175, 0, 25)},
  149.                 {"Font", Enum.Font.Legacy},
  150.                 {"FontSize", Enum.FontSize.Size24},
  151.                 {"Text", "Error: Unknown website"},
  152.                 {"TextColor3", Color3.new(1, 0.2, 0.2)},
  153.                 {"TextStrokeTransparency", 0},
  154.                 {"ZIndex", currentIndex}
  155.             )
  156.            
  157.             local returnHome = edit(
  158.                 Instance.new("TextButton", internetWebsiteDisplay),
  159.                 {"Size", UDim2.new(0, 226, 0, 50)},
  160.                 {"Position", UDim2.new(0.5, -113, 0, 125)},
  161.                 {"Text", "Return to default webpage"},
  162.                 {"FontSize", Enum.FontSize.Size14},
  163.                 {"TextColor3", Color3.new(1, 1, 1)},
  164.                 {"TextStrokeTransparency", 0},
  165.                 {"ZIndex", currentIndex}
  166.             )
  167.             returnHome.MouseButton1Click:connect(function()
  168.                 GLOBALinternetLoadHome()
  169.             end)
  170.         end
  171.     end
  172.    
  173.     function internetLoadHome()
  174.         internetWebsiteDisplay:ClearAllChildren()
  175.        
  176.         internetSearchBar.Text = "Default homepage"
  177.        
  178.         local pageHeader = edit(
  179.             Instance.new("TextLabel", internetWebsiteDisplay),
  180.             {"Size", UDim2.new(0, 1, 0, 1)},
  181.             {"Position", UDim2.new(0.5, 0, 0, 25)},
  182.             {"BorderSizePixel", 0},
  183.             {"BackgroundTransparency", 1},
  184.             {"Text", "Google Chrome"},
  185.             {"FontSize", Enum.FontSize.Size36},
  186.             {"TextStrokeTransparency", 0},
  187.             {"Font", Enum.Font.Legacy},
  188.             {"TextColor3", Color3.new(1, 0.6, 0.6)},
  189.             {"ZIndex", currentIndex}
  190.         )
  191.        
  192.         local favorites = edit(
  193.             Instance.new("Frame", internetWebsiteDisplay),
  194.             {"Size", UDim2.new(0, 150, 0, 275)},
  195.             {"Position", UDim2.new(0.5, -175, 0, 75)},
  196.             {"BackgroundColor3", Color3.new(1, 1, 1)},
  197.             {"ZIndex", currentIndex}
  198.         )
  199.        
  200.         local favHead = edit(
  201.             Instance.new("TextLabel", favorites),
  202.             {"Size", UDim2.new(1, 0, 0, 25)},
  203.             {"TextColor3", Color3.new(1, 0.6, 0.6)},
  204.             {"TextStrokeTransparency", 0},
  205.             {"Text", "Sites to visit"},
  206.             {"BackgroundColor3", Color3.new(0.85, 0.85, 0.85)},
  207.             {"FontSize", Enum.FontSize.Size14},
  208.             {"ZIndex", currentIndex}
  209.         )
  210.        
  211.         local fav1 = edit(
  212.             Instance.new("TextButton", favorites),
  213.             {"Size", UDim2.new(1, 0, 0, 25)},
  214.             {"Position", UDim2.new(0, 0, 0, 50)},
  215.             {"Text", "roblox.com"},
  216.             {"TextColor3", Color3.new(0, 0, 0)},
  217.             {"FontSize", Enum.FontSize.Size12},
  218.             {"BackgroundColor3", Color3.new(1, 0.6, 0.6)},
  219.             {"ZIndex", currentIndex}
  220.         )
  221.         fav1.MouseButton1Click:connect(function()
  222.             internetSearchBar.Text = fav1.Text
  223.             internetSearch(fav1.Text)
  224.         end)
  225.        
  226.         local history = edit(
  227.             Instance.new("Frame", internetWebsiteDisplay),
  228.             {"Size", UDim2.new(0, 150, 0, 275)},
  229.             {"Position", UDim2.new(0.5, 25, 0, 75)},
  230.             {"BackgroundColor3", Color3.new(1, 1, 1)},
  231.             {"ZIndex", currentIndex}
  232.         )
  233.        
  234.         local hisHead = edit(
  235.             Instance.new("TextLabel", history),
  236.             {"Size", UDim2.new(1, 0, 0, 25)},
  237.             {"TextColor3", Color3.new(1, 0.6, 0.6)},
  238.             {"TextStrokeTransparency", 0},
  239.             {"Text", "Search history"},
  240.             {"BackgroundColor3", Color3.new(0.85, 0.85, 0.85)},
  241.             {"FontSize", Enum.FontSize.Size14},
  242.             {"ZIndex", currentIndex}
  243.         )
  244.        
  245.         for i = 1, 9 do
  246.             local direct = edit(
  247.                 Instance.new("TextButton", history),
  248.                 {"Size", UDim2.new(1, 0, 0, 25)},
  249.                 {"Position", UDim2.new(0, 0, 0, 25 + (i * 25))},
  250.                 {"Text", internetSearchHistory[i] or ""},
  251.                 {"BackgroundColor3", Color3.new(1, 1, 1)},
  252.                 {"TextColor3", Color3.new(0, 0, 0)},
  253.                 {"BackgroundColor3", Color3.new(1, 0.6, 0.6)},
  254.                 {"FontSize", Enum.FontSize.Size12},
  255.                 {"ZIndex", currentIndex}
  256.             )
  257.             if not internetSearchHistory[i] then
  258.                 direct.Visible = false
  259.             end
  260.             direct.MouseButton1Click:connect(function()
  261.                 internetSearchBar.Text = direct.Text
  262.                 internetSearch(direct.Text)
  263.             end)
  264.         end
  265.     end
  266.    
  267.     local internetSearchButton = edit(
  268.         Instance.new("ImageButton", internetPage),
  269.         {"Size", UDim2.new(0, 25, 0, 25)},
  270.         {"Position", UDim2.new(1, -50, 0, 10)},
  271.         {"Image", "rbxassetid://169476802"},
  272.         {"BackgroundColor3", Color3.new(1, 1, 1)},
  273.         {"ZIndex", currentIndex}
  274.     )
  275.     internetSearchButton.MouseButton1Click:connect(function()
  276.         local website = internetSearch(internetSearchBar.Text:lower())
  277.     end)
  278.    
  279.     local internetHomeButton = edit(
  280.         Instance.new("ImageButton", internetPage),
  281.         {"Size", UDim2.new(0, 25, 0, 25)},
  282.         {"Position", UDim2.new(0, 25, 0, 10)},
  283.         {"Image", "rbxassetid://35660725"},
  284.         {"BackgroundColor3", Color3.new(1, 1, 1)},
  285.         {"ZIndex", currentIndex}
  286.     )
  287.     internetHomeButton.MouseButton1Click:connect(function()
  288.         internetLoadHome()
  289.     end)
  290.    
  291.     local internetIcon = edit(
  292.         Instance.new("ImageButton", computer.screen),
  293.         {"Position", UDim2.new(0, 10, 1, -60)},
  294.         {"Image", "rbxassetid://72777962"},
  295.         getSkin("icon")
  296.     )
  297.     local internetIconBack = hookUpHoverEvents(internetIcon)
  298.     internetIcon.MouseButton1Click:connect(function()
  299.         internetLoadHome()
  300.         internetIconBack()
  301.         internetPage:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Bounce", 1)
  302.     end)
  303.    
  304.     local internetClose = edit(
  305.         Instance.new("ImageButton", internetPage),
  306.         {"ZIndex", currentIndex},
  307.         {"Position", UDim2.new(1, -20, 0, 0)},
  308.         getSkin("close_button")
  309.     )
  310.     internetClose.MouseButton1Click:connect(function()
  311.         internetPage:TweenPosition(UDim2.new(0, 0, -1, 0), "Out", "Linear", 0.5)
  312.     end)
  313.    
  314.     local wordIcon = edit(
  315.         Instance.new("ImageButton", computer.screen),
  316.         {"Position", UDim2.new(0, 70, 1, -60)},
  317.         {"Image", "rbxassetid://"},
  318.         getSkin("icon")
  319.     )
  320.    
  321.     powerOn()
  322. end
  323.  
  324.  
  325. function powerOn()
  326.     computer.screen:WaitForChild("ScreenCover"):Destroy()
  327.     local black = edit(
  328.         Instance.new("TextLabel", computer.screen),
  329.         getSkin("blanket")
  330.     )
  331.     for i = 1, 50 do
  332.         wait()
  333.         edit(black, {"BackgroundTransparency", black.BackgroundTransparency + 1/50})
  334.     end
  335.     black:Destroy()
  336. end
  337.  
  338. function powerOff()
  339.     local black = edit(
  340.         Instance.new("TextLabel", computer.screen),
  341.         {"BackgroundTransparency", 1},
  342.         {"Name", "ScreenCover"},
  343.         getSkin("blanket")
  344.     )
  345.     for i = 1, 50 do
  346.         wait()
  347.         edit(black, {"BackgroundTransparency", black.BackgroundTransparency - 1/50})
  348.     end
  349. end
  350.  
  351.  
  352. generateUI()
Advertisement
Add Comment
Please, Sign In to add comment