princeofheaven

Despairus

Jun 3rd, 2015
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.86 KB | None | 0 0
  1. --[[ About: Samsung Galaxy Tab S
  2. Created entirely by Despairus and inspired by RiOS.
  3. This script MUST be local.
  4. When ran: click with the tablet tool selected to spawn the destablet.
  5. This is the destablet, with it's immense processing speed, action-packed with 8 GB of space!
  6. Need to calculate something on the go? Wanna play that new tileblox adventure game? Need to write down a quick thought in a note?
  7. The destablet has it all.
  8. MADE BY DESPAIRUS!
  9. Enjoy.
  10. ]]
  11.  
  12. --[[ NOTES TO SELF:
  13. RADAR ID: 149177741 and 6314249 ]]
  14.  
  15. --[[ Todo:
  16. make a notification function.
  17. work on top right corner button which instead of powers off tablet, turns it into a platform.
  18. ]]
  19.  
  20. --[[ UPDATES:
  21. Notes app has been successfully completed.
  22. Radar and iMessage 88% perfected, which is good enough for now.
  23. ]]
  24.  
  25. --local Username = "Despairus"
  26. local ontablet = game:GetService("UserInputService").TouchEnabled
  27. local Version = "0.2.99"
  28. local xangle = math.rad(28)
  29. local surfing = false
  30. local oldcam = game.Workspace.Camera.CameraType
  31.  
  32. --[[ How to run:
  33. Create a new note on code.stypi.com and then in a script builder
  34. (preferably oxcool1's or antiboomz0r's) chat: /e hl/(stypi link)
  35. and before the stypi ID at the end put raw/
  36. example: /e hl/https://code.stypi.com/raw/5cd8oaoh
  37. putting /e before it makes the chat hidden for other users.
  38. ]]
  39.  
  40. --[[ 0:Legacy, 1:Arial, 2:ArialBold, 3:SourceSans, 4:SourceSansBold ]]
  41. local mainfont = "Legacy"
  42. local fonttypes = {"Legacy", "Arial", "ArialBold", "SourceSans", "SourceSansBold"}
  43. local brickcolors = {"Really red", "Bright red", "Bright blue", "Teal", "Bright purple", "Bright orange", "Bright green", "Lime green", "White", "Medium stone grey", "Black", "Really black"}
  44. backgroundids = {"169809773", "76315925", "103375265", "172249714", "123567232", "59625532", "122004466"}
  45. backgroundnames = {"Desert Mountain", "New york city", "Flowers", "Minecraft", "Beach", "Beach2", "Beach3"}
  46.  
  47. AppStorage = {}
  48. AppStorage.NotesApp = {}
  49. AppStorage.NotesApp.Notes = {}
  50. AppStorage.NotesApp.Titles = {}
  51. AppStorage.NotesApp.Contents = {}
  52.  
  53. local bg_index = 5
  54. local bg_image_id = backgroundids[bg_index]
  55. local bg_image_name = backgroundnames[bg_index]
  56.  
  57. processing_con = nil
  58. btnDown_tabletbegin = nil
  59. keydown_con = nil
  60. keyup_con = nil
  61.  
  62. TabletBegun = false
  63. appopened = false
  64. ismodal = true
  65. totalmbspace = (8 * 1000) --[[ 8 GB ]]
  66. usedmbspace = 0
  67. appnames = {}
  68. totalApps = 0
  69. local columns = 0
  70. local rows = 1
  71.  
  72. --local User = game.Players[Username]
  73. local User = game.Players.LocalPlayer
  74. local Username = User.Name
  75.  
  76. local Tool = Instance.new("Tool", User.Backpack)
  77. Tool.Name = Username.."'s Tablet"
  78. Tool.ToolTip = Tool.Name
  79.  
  80. local handle = Instance.new("Part", Tool)
  81. handle.BrickColor = BrickColor.new("Really black")
  82. handle.FormFactor = "Custom"
  83. handle.Size = Vector3.new(3,3,1)
  84. handle.Name = "Handle"
  85. handle.Locked = true
  86.  
  87. local ipad = Instance.new("SpecialMesh", handle)
  88. ipad.MeshType = "FileMesh"
  89. ipad.MeshId = "http://www.roblox.com/asset?id=97689497"
  90. ipad.TextureId = "http://www.roblox.com/asset?id=99286891"
  91.  
  92. local currentApp = Instance.new("StringValue", handle)
  93. currentApp.Name = "CurrentApp"
  94. currentApp.Value = ""
  95.  
  96. local c_angle = Instance.new("Vector3Value", handle)
  97. c_angle.Name = "Angle"
  98.  
  99. function isnumber(x)
  100. if not x then return end
  101. if (type(tonumber(x)) == "number") then
  102. return true
  103. else
  104. return false
  105. end
  106. end
  107.  
  108. function str_explode(divider, text)
  109. if text == nil or divider == nil then return {} end
  110. if tostring(text) == "" then return {} end
  111. if tostring(divider) == "" then return {text} end
  112. local text = tostring(text)
  113. local divider = tostring(divider)
  114. local position = 0
  115. local words = {}
  116. for start, stop in function() return string.find(text, divider, position, true) end do
  117. table.insert(words, string.sub(text, position, start - 1))
  118. position = stop + 1
  119. end
  120. table.insert(words, string.sub(text, position))
  121. return words
  122. end
  123.  
  124. function alert(par, txt, dur)
  125. if par:findFirstChild("ALERT") == nil then
  126. local txtlbl = Instance.new("TextLabel", par)
  127. txtlbl.Size = UDim2.new(1,0,1,0)
  128. txtlbl.BackgroundColor3 = Color3.new(0,0,0)
  129. txtlbl.TextColor3 = Color3.new(1,1,1)
  130. txtlbl.FontSize = "Size48"
  131. txtlbl.TextWrapped = true
  132. txtlbl.Name = "ALERT"
  133. txtlbl.Font = mainfont
  134. txtlbl.ZIndex = 10
  135. txtlbl.Text = txt
  136.  
  137. Delay(dur, function()
  138. for i = 1,10 do
  139. txtlbl.BackgroundTransparency = txtlbl.BackgroundTransparency + 0.1
  140. txtlbl.TextTransparency = txtlbl.TextTransparency + 0.1
  141. wait(0.1)
  142. end
  143. txtlbl:Destroy()
  144. end)
  145. end
  146. end
  147.  
  148. function tempHL(ob) --[[ temporary highlights for mouse clicks ]]
  149. local oldbg = ob.BackgroundColor3
  150. ob.BackgroundColor3 = Color3.new(1,1,0)
  151. Delay(0.4, function()
  152. if ob.Parent ~= nil then
  153. ob.BackgroundColor3 = oldbg
  154. end
  155. end)
  156. end
  157.  
  158. function prompt(par, caption, placeholder, onsubmit)
  159. if User.PlayerGui:findFirstChild("PROMPT") ~= nil then return end
  160.  
  161. local main = Instance.new("ScreenGui", User.PlayerGui)
  162. main.Name = "PROMPT"
  163.  
  164. local f = Instance.new("Frame", main)
  165. f.BackgroundColor3 = Color3.new(0,0,0)
  166. f.BorderColor3 = Color3.new(1,1,1)
  167. f.Position = UDim2.new(.4,0,.4,0)
  168. f.Name = "PROMPT"
  169. local exitbtnx = 0.12
  170.  
  171. local txtbox = Instance.new("TextBox", f)
  172. local submit = Instance.new("TextButton", f)
  173. submit.BackgroundColor3 = Color3.new(0,1,0)
  174. submit.BorderColor3 = Color3.new(1,1,1)
  175. submit.TextColor3 = Color3.new(1,1,1)
  176. submit.Size = UDim2.new(1,0,.15,0)
  177. submit.Position = UDim2.new(0,0,1,0)
  178. submit.FontSize = "Size18"
  179. submit.Font = mainfont
  180. submit.Text = "Submit"
  181. submit.Modal = ismodal
  182. submit.ZIndex = 5
  183. submit.MouseButton1Down:connect(function()
  184. xpcall(function() onsubmit(txtbox.Text) main:Remove() end, function(Error)
  185. alert(par, "Error: " ..Error, 2)
  186. CloseApps(par)
  187. main:Remove()
  188. end)
  189. end)
  190.  
  191. local cap = Instance.new("TextLabel", f)
  192. cap.BackgroundColor3 = Color3.new(0,0,0)
  193. cap.BorderColor3 = Color3.new(1,1,1)
  194. cap.TextColor3 = Color3.new(1,1,1)
  195. cap.Size = UDim2.new(1-exitbtnx,0,0.14,0)
  196. cap.FontSize = "Size18"
  197. cap.Font = mainfont
  198. cap.Text = caption
  199.  
  200. txtbox.BackgroundColor3 = Color3.new(0,0,0)
  201. txtbox.BorderColor3 = Color3.new(1,1,1)
  202. txtbox.TextColor3 = Color3.new(1,1,1)
  203. txtbox.Size = UDim2.new(1,0,1-(submit.Size.Y.Scale-cap.Size.Y.Scale),0)
  204. txtbox.Position = UDim2.new(0,0,cap.Size.Y.Scale,0)
  205. txtbox.ClearTextOnFocus = false
  206. txtbox.TextWrapped = true
  207. txtbox.MultiLine = true
  208. txtbox.Text = ""
  209.  
  210. local exit = Instance.new("TextButton", f)
  211. exit.BackgroundColor3 = Color3.new(1,0,0)
  212. exit.BorderColor3 = Color3.new(1,1,1)
  213. exit.TextColor3 = Color3.new(1,1,1)
  214. exit.Size = UDim2.new(exitbtnx,0,cap.Size.Y.Scale,0)
  215. exit.Position = UDim2.new(1-exitbtnx,0,0,0)
  216. exit.FontSize = "Size18"
  217. exit.Modal = ismodal
  218. exit.Font = mainfont
  219. exit.Text = "X"
  220. exit.MouseButton1Down:connect(function() main:Remove() end)
  221.  
  222. f:TweenSize(UDim2.new(.34,0,.34,0), "Out", "Quad", 0.4, false, nil)
  223. end
  224.  
  225. function listprompt(par, caption, contents, onselect)
  226. if User.PlayerGui:findFirstChild("PROMPT") ~= nil then return end
  227. local main = Instance.new("ScreenGui", User.PlayerGui)
  228. main.Name = "LISTPROMPT"
  229.  
  230. local f = Instance.new("Frame", main)
  231. f.BackgroundColor3 = Color3.new(0,0,0)
  232. f.BorderColor3 = Color3.new(1,1,1)
  233. f.Position = UDim2.new(.4,0,.4,0)
  234. f.Name = "LISTPROMPT"
  235. local exitbtnx = 0.12
  236.  
  237. local cap = Instance.new("TextLabel", f)
  238. cap.BackgroundColor3 = Color3.new(0,0,0)
  239. cap.BorderColor3 = Color3.new(1,1,1)
  240. cap.TextColor3 = Color3.new(1,1,1)
  241. cap.Size = UDim2.new(1-exitbtnx,0,0.14,0)
  242. cap.FontSize = "Size18"
  243. cap.Font = mainfont
  244. cap.Text = caption
  245.  
  246. local fscroll = Instance.new("ScrollingFrame", f)
  247. fscroll.BackgroundColor3 = Color3.new(0,0,0)
  248. fscroll.BorderColor3 = Color3.new(1,1,1)
  249. fscroll.Size = UDim2.new(1,0,1-cap.Size.Y.Scale,0)
  250. fscroll.Position = UDim2.new(0,0,cap.Size.Y.Scale,0)
  251.  
  252. for i = 1,#contents do
  253. local btn = Instance.new("TextButton", fscroll)
  254. btn.BackgroundColor3 = Color3.new(0,0,0)
  255. btn.BorderColor3 = Color3.new(1,1,1)
  256. btn.TextColor3 = Color3.new(1,1,1)
  257. btn.Size = UDim2.new(1,0,0.14,0)
  258. btn.Position = UDim2.new(0,0,(btn.Size.Y.Scale*i)-btn.Size.Y.Scale,0)
  259. btn.Modal = ismodal
  260. btn.FontSize = "Size14"
  261. btn.Font = mainfont
  262. btn.Text = contents[i]
  263. btn.Name = "btn" ..i
  264. btn.MouseButton1Down:connect(function() onselect(contents[i], i) main:remove() end)
  265. end
  266.  
  267. local exit = Instance.new("TextButton", f)
  268. exit.BackgroundColor3 = Color3.new(1,0,0)
  269. exit.BorderColor3 = Color3.new(1,1,1)
  270. exit.TextColor3 = Color3.new(1,1,1)
  271. exit.Size = UDim2.new(exitbtnx,0,cap.Size.Y.Scale,0)
  272. exit.Position = UDim2.new(1-exitbtnx,0,0,0)
  273. exit.FontSize = "Size18"
  274. exit.Modal = ismodal
  275. exit.Font = mainfont
  276. exit.Text = "X"
  277. exit.MouseButton1Down:connect(function() main:Remove() end)
  278.  
  279. f:TweenSize(UDim2.new(.34,0,.34,0), "Out", "Quad", 0.4, false, nil)
  280. end
  281.  
  282. function CloseApps(par)
  283. if par:findFirstChild("AppDisplay") then
  284. par.AppDisplay:TweenSize(UDim2.new(0,0,0,0), "Out", "Quad", 0.2, false, nil)
  285. wait(0.2)
  286. par.AppDisplay.Active = false
  287. par.AppDisplay.Visible = false
  288. for _,v in pairs(par.AppDisplay:GetChildren()) do
  289. v:remove()
  290. end
  291. end
  292. if par:findFirstChild("BGDisplay") then
  293. par.BGDisplay.Visible = true
  294. par.BGDisplay.Active = true
  295. end
  296. appopened = false
  297. currentApp.Value = ""
  298. if keydown_con ~= nil then
  299. keydown_con:disconnect()
  300. keydown_con = nil
  301. end
  302. if keyup_con ~= nil then
  303. keyup_con:disconnect()
  304. keyup_con = nil
  305. end
  306. if processing_con ~= nil then
  307. processing_con:disconnect()
  308. processing_con = nil
  309. end
  310. end
  311.  
  312. function CreateApp(par, appname, imageid, mbspace, mousedown)
  313. if not par:findFirstChild("BGDisplay") then return end
  314. if not par:findFirstChild("AppDisplay") then return end
  315. if not par:findFirstChild("TopBanner") then return end
  316.  
  317. if ((usedmbspace+mbspace) > totalmbspace) then return end
  318. if ((usedmbspace+mbspace) < totalmbspace) then
  319. usedmbspace = usedmbspace + mbspace
  320. end
  321.  
  322. totalApps=totalApps+1
  323. columns=columns+1
  324. table.insert(appnames, appname)
  325. if columns > 3 then rows=rows+1 columns=1 end
  326.  
  327. local ibtn = Instance.new("ImageButton", par.BGDisplay)
  328. ibtn.Size = UDim2.new(.16,0,.16,0)
  329. ibtn.Position = UDim2.new((columns*(ibtn.Size.X.Scale+.1))-.2,0,rows*(ibtn.Size.Y.Scale+.1)-.2,0)
  330. ibtn.ZIndex = 2
  331. ibtn.Image = "http://www.roblox.com/asset/?id=" ..imageid
  332.  
  333. local title = Instance.new("TextLabel", par.BGDisplay)
  334. title.Size = UDim2.new(.1,0,.07,0)
  335. title.Position = ibtn.Position + UDim2.new(0.03,0,ibtn.Size.Y.Scale,0)
  336. title.BackgroundTransparency = 1
  337. title.TextColor3 = Color3.new(1,1,1)
  338. title.FontSize = "Size36"
  339. title.Font = mainfont
  340. title.Text = string.sub(appname,1,7).. "..."
  341.  
  342. ibtn.MouseButton1Down:connect(function()
  343. tempHL(ibtn)
  344. appopened = true
  345. currentApp.Value = appname
  346. par.BGDisplay.Visible = false
  347. par.BGDisplay.Active = false
  348. par.AppDisplay.Visible = true
  349. par.AppDisplay.Active = true
  350. par.AppDisplay:TweenSize(UDim2.new(1,0,.88-par.TopBanner.Size.Y.Scale,0), "Out", "Quad", 0.5, false, nil)
  351. xpcall(mousedown, function(Error)
  352. alert(par, "Error: " ..Error, 2)
  353. CloseApps(par)
  354. end)
  355. end)
  356. end
  357.  
  358. function TabletBegin()
  359. TabletBegun = true
  360.  
  361. local main = Instance.new("SurfaceGui", handle)
  362. main.Name = "TabletInterface"
  363. main.Face = "Back"
  364. alert(main, "Hello " ..Username, 1)
  365.  
  366. --[[ this frame contains all background things; all data on the home screen ]]
  367. local bgdisplay = Instance.new("Frame", main)
  368. bgdisplay.Position = UDim2.new(0,0,0,0)
  369. bgdisplay.BackgroundTransparency = 1
  370. bgdisplay.Size = UDim2.new(1,0,1,0)
  371. bgdisplay.Name = "BGDisplay"
  372. bgdisplay.Visible = true
  373. bgdisplay.Active = true
  374.  
  375. local background = Instance.new("ImageLabel", main)
  376. background.Image = "http://www.roblox.com/asset/?id=" ..bg_image_id
  377. background.Size = UDim2.new(1,0,1,0)
  378. background.BackgroundTransparency = .3
  379. background.ZIndex = 0
  380.  
  381. local TopBanner = Instance.new("TextLabel",main)
  382. TopBanner.BackgroundColor3 = Color3.new(0,0,0)
  383. TopBanner.TextColor3 = Color3.new(1,1,1)
  384. TopBanner.Size = UDim2.new(1,0,0.062,0)
  385. TopBanner.FontSize = "Size36"
  386. TopBanner.Font = mainfont
  387. TopBanner.ZIndex = 10
  388. TopBanner.Name = "TopBanner"
  389.  
  390. --[[ this is the frame containing all data to do with apps ]]
  391. local appdisplay = Instance.new("Frame", main)
  392. appdisplay.BackgroundColor3 = Color3.new(0,0,0)
  393. appdisplay.Position = UDim2.new(0,0,TopBanner.Size.Y.Scale,0)
  394. appdisplay.BackgroundTransparency = 0
  395. appdisplay.Size = UDim2.new(0,0,0,0)
  396. appdisplay.Name = "AppDisplay"
  397. appdisplay.Visible = false
  398. appdisplay.Active = false
  399. appdisplay.ZIndex = 1
  400.  
  401. local btnhome = Instance.new("TextButton", main)
  402. btnhome.Modal = ismodal
  403. btnhome.BorderColor3 = Color3.new(178,178,178)
  404. btnhome.Size = UDim2.new(0.2,0,0.1,0)
  405. btnhome.Position = UDim2.new(0.5-btnhome.Size.X.Scale/2,0,1-btnhome.Size.Y.Scale,0)
  406. btnhome.BackgroundColor3 = Color3.new(0,0,0)
  407. btnhome.TextColor3 = Color3.new(1,1,1)
  408. btnhome.Style = "RobloxButton"
  409. btnhome.Font = mainfont
  410. btnhome.Text = "Home"
  411. btnhome.FontSize = "Size36"
  412. btnhome.ZIndex = 10
  413. btnhome.MouseButton1Down:connect(function() tempHL(btnhome) CloseApps(main) end)
  414.  
  415. local function apps_settings()
  416. local ndata = 0
  417. local function addtab(txt, value, mousedown)
  418. ndata = ndata + 1
  419. local tab = Instance.new("TextButton", appdisplay)
  420. tab.Modal = ismodal
  421. tab.BackgroundColor3 = Color3.new(0,0,0)
  422. tab.BorderColor3 = Color3.new(1,1,1)
  423. tab.TextColor3 = Color3.new(1,1,1)
  424. tab.Size = UDim2.new(.5,0,.075,0)
  425. tab.Position = UDim2.new(0,0,((ndata*tab.Size.Y.Scale)-tab.Size.Y.Scale),0)
  426. tab.ZIndex = 8
  427. tab.FontSize = "Size36"
  428. tab.Font = mainfont
  429. tab.Text = txt
  430. local tab2 = tab:Clone()
  431. tab2.Parent = appdisplay
  432. tab2.Position = tab.Position + UDim2.new(tab.Size.X.Scale,0,0,0)
  433. tab2.Text = value
  434. if mousedown ~= nil then
  435. tab2.MouseButton1Down:connect(function()
  436. tempHL(tab2)
  437. xpcall(function() mousedown(tab2) end, function(Error)
  438. alert(main, "Error: " ..Error, 2)
  439. end)
  440. end)
  441. end
  442. end
  443.  
  444. addtab("Version: ", Version, nil)
  445. addtab("Total Space: ", math.floor(totalmbspace/1000).. "gb; " ..(totalmbspace % 1000).. "mb", nil)
  446. addtab("Used Space: ", math.floor(usedmbspace/1000).. "gb and " ..(usedmbspace % 1000).. "mb", nil)
  447. addtab("Font", mainfont, function(fonttab)
  448. listprompt(main, "Select font:", fonttypes, function(input, index)
  449. mainfont = input
  450. fonttab.Text = mainfont
  451. end)
  452. end)
  453. addtab("Tablet color", tostring(handle.BrickColor), function(colortab)
  454. listprompt(main, "Select color:", brickcolors, function(input, index)
  455. handle.BrickColor=BrickColor.new(input)
  456. colortab.Text = input
  457. end)
  458. end)
  459. addtab("Background", bg_image_name, function(bgtab)
  460. listprompt(main, "Select color:", backgroundnames, function(input, index)
  461. bg_image_id = backgroundids[index]
  462. bg_image_name = input
  463. bgtab.Text = input
  464. background.Image = "http://www.roblox.com/asset/?id=" ..bg_image_id
  465. end)
  466. end)
  467. addtab("Username: ", Username, function(nametab)
  468. local h = User.Character:findFirstChild("Head")
  469. local fakeheadmodel = User.Character:findFirstChild("FAKEHEAD")
  470.  
  471. if h ~= nil and fakeheadmodel == nil then
  472. fakeheadmodel = Instance.new("Model", User.Character)
  473. fakeheadmodel.Name = "FAKEHEAD"
  474. local title = Instance.new("Model", fakeheadmodel)
  475. title.Name = Username
  476. charname = title
  477. local fakehead = h:Clone()
  478. fakehead.Parent = title
  479. local w = Instance.new("Weld", h)
  480. w.Part0 = h
  481. w.Part1 = fakehead
  482. h.Transparency = 0
  483. Instance.new("Humanoid", title).MaxHealth = 0
  484. end
  485.  
  486. if fakeheadmodel ~= nil then
  487. local title = fakeheadmodel:GetChildren()[1]
  488. prompt(main, "Enter name: ", Username, function(value) title.Name=value nametab.Text=value end)
  489. end
  490. end)
  491. end
  492.  
  493. local function apps_calculator()
  494. local result = Instance.new("TextLabel", appdisplay)
  495. result.BackgroundColor3 = Color3.new(210,210,210)
  496. result.BorderColor3 = Color3.new(178,178,178)
  497. result.Position = UDim2.new(0.1,0,0.1,0)
  498. result.Size = UDim2.new(0.8,0,0.1,0)
  499. result.FontSize = "Size36"
  500. result.ZIndex = (appdisplay.ZIndex+1)
  501. result.Font = mainfont
  502. result.Text = ""
  503.  
  504. local _rows = 1
  505. local _columns = 0
  506. local operator = ""
  507.  
  508. local function addButton(txt, mousedown)
  509. _columns = _columns + 1
  510. if _columns > 4 then _columns=1 _rows=_rows+1 end
  511. local btn = Instance.new("TextButton", appdisplay)
  512. btn.Modal = ismodal
  513. btn.Position = UDim2.new(0.1+(_columns*0.1),0,0.1+(_rows*0.1),0)
  514. btn.TextColor3 = Color3.new(1,1,1)
  515. btn.Size = UDim2.new(0.1,0,0.1,0)
  516. btn.ZIndex = (appdisplay.ZIndex+1)
  517. btn.Style = "RobloxButton"
  518. btn.FontSize = "Size36"
  519. btn.Font = mainfont
  520. btn.Text = txt
  521. btn.MouseButton1Down:connect(function()
  522. tempHL(btn)
  523. xpcall(function() mousedown(btn) end, function(Error)
  524. alert(main, "Error: " ..Error, 2)
  525. end)
  526. end)
  527. end
  528.  
  529. addButton("0", function(b) result.Text=result.Text.. "" ..b.Text end)
  530. addButton("1", function(b) result.Text=result.Text.. "" ..b.Text end)
  531. addButton("2", function(b) result.Text=result.Text.. "" ..b.Text end)
  532. addButton("3", function(b) result.Text=result.Text.. "" ..b.Text end)
  533. addButton("4", function(b) result.Text=result.Text.. "" ..b.Text end)
  534. addButton("5", function(b) result.Text=result.Text.. "" ..b.Text end)
  535. addButton("6", function(b) result.Text=result.Text.. "" ..b.Text end)
  536. addButton("7", function(b) result.Text=result.Text.. "" ..b.Text end)
  537. addButton("8", function(b) result.Text=result.Text.. "" ..b.Text end)
  538. addButton("9", function(b) result.Text=result.Text.. "" ..b.Text end)
  539. addButton(".", function(b) result.Text=result.Text.. "" ..b.Text end)
  540. addButton("+", function(b)
  541. if not string.match(result.Text, "+") then
  542. result.Text=result.Text.. "" ..b.Text
  543. operator = b.Text
  544. end
  545. end)
  546. addButton("-", function(b)
  547. if not string.match(result.Text, "-") then
  548. result.Text=result.Text.. "" ..b.Text
  549. operator = b.Text
  550. end
  551. end)
  552. addButton("*", function(b)
  553. if not string.match(result.Text, "*") then
  554. result.Text=result.Text.. "" ..b.Text
  555. operator = b.Text
  556. end
  557. end)
  558. addButton("/", function(b)
  559. if not string.match(result.Text, "/") then
  560. result.Text=result.Text.. "" ..b.Text
  561. operator = b.Text
  562. end
  563. end)
  564. addButton("C", function(b) result.Text="" operator="" end)
  565. addButton("=", function(b)
  566. local segments = str_explode(operator, result.Text)
  567. if #segments == 2 then
  568. local first = segments[1]
  569. local second = segments[2]
  570. if isnumber(first) and isnumber(second) then
  571. if operator == "+" then
  572. result.Text = (first + second)
  573. elseif operator == "-" then
  574. result.Text = (first - second)
  575. elseif operator == "*" then
  576. result.Text = (first * second)
  577. elseif operator == "/" then
  578. result.Text = (first / second)
  579. end
  580. else
  581. alert(main, "Error", .8)
  582. end
  583. else
  584. alert(main, "Error", .8)
  585. end
  586. end)
  587. end
  588.  
  589. local function apps_bloxx()
  590. local UserMouse = nil
  591. if not ontablet then
  592. if not User:GetMouse() then return end
  593. UserMouse = User:GetMouse()
  594. end
  595. alert(main, "Use J K and L to move", 2)
  596.  
  597. --[[ special tiles are in 100's ]]
  598. local T = 100 --[[ Treasure chest ]]
  599. local K = 101 --[[ Key ]]
  600. local D = 102 --[[ Door ]]
  601. --[[ animate objects in 200's ]]
  602. local G = 200 --[[ Goomba ]]
  603.  
  604. local map1 = {{1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
  605. {1,T,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,G,0,1,1,1,0,0,0,0,0,1},
  606. {1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,2,2,2,2,2,0,0,0,2,2,0,0,0,1},
  607. {1,0,0,0,0,2,2,0,0,0,1,0,0,0,2,T,0,0,0,0,0,0,0,0,0,2,2,0,1},
  608. {1,0,0,0,2,T,0,0,2,0,0,0,0,2,T,K,0,0,0,0,0,0,G,0,0,0,0,0,D},
  609. {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}}
  610.  
  611. local playerWalkForward = {"34311544","34311604","34311544","34311604","34311544"}
  612. local playerWalkBackward = {"34311571","34311625","34311571","34311625","34311571"}
  613.  
  614. local tiletypes = Instance.new("Model", appdisplay)
  615. tiletypes.Name = "Tiles"
  616.  
  617. local tiles,enemies = {},{}
  618. local platforming = true
  619. local tilexsize = 0.2
  620. local tileysize = 0.15
  621. local points = 0
  622. local holdingKey = false
  623.  
  624. local mleft = Instance.new("TextButton", appdisplay)
  625. mleft.Modal = ismodal
  626. mleft.BackgroundColor3 = Color3.new(0,0,0)
  627. mleft.BorderColor3 = Color3.new(1,1,1)
  628. mleft.TextColor3 = Color3.new(1,1,1)
  629. mleft.Size = UDim2.new(.14,0,1,0)
  630. mleft.FontSize = "Size24"
  631. mleft.Font = mainfont
  632. mleft.ZIndex = 10
  633. mleft.Text = "<"
  634. local mright = mleft:Clone()
  635. mright.Parent = appdisplay
  636. mright.Text = ">"
  637. mright.Position = UDim2.new(1-mleft.Size.X.Scale,0,0,0)
  638.  
  639. local world = Instance.new("Frame", appdisplay)
  640. world.Position = UDim2.new(mleft.Size.X.Scale,0,0,0)
  641. world.Size = UDim2.new(1-(mleft.Size.X.Scale*2),0,1,0)
  642. world.BackgroundTransparency = 1
  643. world.BorderColor3 = Color3.new(1,1,1)
  644. world.Name = "World"
  645. world.ZIndex = 4
  646.  
  647. local BaseTile = Instance.new("ImageLabel")
  648. BaseTile.Size = UDim2.new(tilexsize,0,tileysize,0)
  649. BaseTile.Image = ""
  650. BaseTile.ZIndex = 5
  651.  
  652. --[[ 0 = sky(nothing) ]]
  653. local Tile0 = BaseTile:Clone()
  654. Tile0.Parent = tiletypes
  655. Tile0.BackgroundColor3 = Color3.new(.3,.7,.9)
  656. Tile0.Name = "Tile0"
  657.  
  658. --[[ 1 = black brick tile (collidable) ]]
  659. local Tile1 = BaseTile:Clone()
  660. Tile1.Parent = tiletypes
  661. Tile1.BackgroundColor3 = Color3.new(0,0,0)
  662. Tile1.Image = "http://www.roblox.com/asset/?id=80629180"
  663. Tile1.Name = "Tile1"
  664.  
  665. --[[ 2 = grass tile (collidable) ]]
  666. local Tile2 = BaseTile:Clone()
  667. Tile2.Parent = tiletypes
  668. Tile2.BackgroundColor3 = Color3.new(0,1,0)
  669. Tile2.Image = "http://www.roblox.com/asset/?id=50975701"
  670. Tile2.Name = "Tile2"
  671.  
  672. --[[ T = treasure tile ]]
  673. local TileT = BaseTile:Clone()
  674. TileT.Parent = tiletypes
  675. TileT.BackgroundColor3 = Tile0.BackgroundColor3
  676. TileT.Image = "http://www.roblox.com/asset/?id=25620639"
  677. TileT.Name = "Tile" ..T
  678.  
  679. --[[ K = Key tile ]]
  680. local TileK = BaseTile:Clone()
  681. TileK.Parent = tiletypes
  682. TileK.BackgroundColor3 = Tile0.BackgroundColor3
  683. TileK.Image = "http://www.roblox.com/asset/?id=125195003"
  684. TileK.Name = "Tile" ..K
  685.  
  686. local TileD = BaseTile:Clone()
  687. TileD.Parent = tiletypes
  688. TileD.Image = "http://www.roblox.com/asset/?id=75583051"
  689. TileD.Name = "Tile" ..D
  690.  
  691. --[[ G = goomba tile ]]
  692. local TileG = BaseTile:Clone()
  693. TileG.Parent = tiletypes
  694. TileG.BackgroundColor3 = Tile0.BackgroundColor3
  695. TileG.Image = "http://www.roblox.com/asset/?id=42952007"
  696. TileG.Name = "Tile" ..G
  697. local gdir=Instance.new("StringValue", TileG)
  698. gdir.Name = "Direction"
  699. gdir.Value = "Left"
  700. local gsteps=Instance.new("IntValue", TileG)
  701. gsteps.Name = "Steps"
  702. gsteps.Value = 0
  703.  
  704. local btnjump = Instance.new("TextButton", appdisplay)
  705. btnjump.Modal = ismodal
  706. btnjump.Size = UDim2.new(.5-mleft.Size.X.Scale,0,.08,0)
  707. btnjump.Position = UDim2.new(mleft.Size.X.Scale,0,1-btnjump.Size.Y.Scale,0)
  708. btnjump.BackgroundColor3 = Color3.new(0,0,0)
  709. btnjump.BorderColor3 = Color3.new(1,1,1)
  710. btnjump.TextColor3 = Color3.new(1,1,1)
  711. btnjump.FontSize = "Size36"
  712. btnjump.Font = mainfont
  713. btnjump.ZIndex = mleft.ZIndex
  714. btnjump.Text = "^"
  715.  
  716. local txtpoints = Instance.new("TextLabel", appdisplay)
  717. txtpoints.Size = btnjump.Size
  718. txtpoints.BackgroundColor3 = Color3.new(0,0,0)
  719. txtpoints.BorderColor3 = Color3.new(1,1,1)
  720. txtpoints.TextColor3 = Color3.new(1,1,1)
  721. txtpoints.Position = btnjump.Position + UDim2.new(btnjump.Size.X.Scale,0,0,0)
  722. txtpoints.FontSize = "Size36"
  723. txtpoints.Font = mainfont
  724. txtpoints.ZIndex = mleft.ZIndex
  725.  
  726. local charVelocityX,charVelocityY,walkCounter = 0,0,0
  727. local charxtile,charytile = 3,5
  728. local charspeed = .02
  729. local jumpheight = .05
  730. local gravity = .004
  731. local vmaxfall = .06
  732. local facing = "right"
  733. local movingleft = false
  734. local movingright = false
  735.  
  736. local function buildMap(map)
  737. for y = 1,#map do
  738. for x = 1,#map[1] do
  739. local tile = tiletypes:findFirstChild("Tile" ..map[y][x])
  740. if tile ~= nil then
  741. local newtile = tile:Clone()
  742. newtile.Position = UDim2.new((x*tilexsize)-tilexsize,0,(y*tileysize)-tilexsize,0)
  743. newtile.Parent = world
  744. newtile.Name = "tile" ..map[y][x].. "_y" ..y.. "_x" ..x
  745. table.insert(tiles, newtile)
  746. if map[y][x] >= T then
  747. local fill = Tile0:Clone()
  748. fill.Parent = world
  749. fill.Name = "fill" ..map[y][x].. "_y" ..y.. "_x" ..x
  750. fill.Position = newtile.Position
  751. table.insert(tiles, fill)
  752. end
  753. end
  754. end
  755. end
  756. end
  757.  
  758. buildMap(map1)
  759.  
  760. local char = Instance.new("ImageLabel", world)
  761. char.Size = UDim2.new(.17,0,.15,0)
  762. --[[char.Position = UDim2.new(.5-(char.Size.X.Scale/2),0,1-char.Size.Y.Scale,0)]]
  763. char.Position = UDim2.new((charxtile*tilexsize)-tilexsize,0,(charytile*tileysize)-tileysize-(tileysize/3),0)
  764. char.Image = "http://www.roblox.com/asset/?id=" ..playerWalkForward[1]
  765. char.BackgroundTransparency = 1
  766. char.ZIndex = 9
  767.  
  768. local function Touching(g1,g2)
  769. local col,p1,p2 = "",g1.Position,g2.Position
  770. --[[ downward edge ]]
  771. if p1.Y.Scale < p2.Y.Scale + g2.Size.Y.Scale and p1.Y.Scale > p2.Y.Scale - (g2.Size.Y.Scale/2) and (p1.X.Scale+1) < p2.X.Scale + g2.Size.X.Scale and p1.X.Scale + g1.Size.X.Scale > (p2.X.Scale-1) then
  772. col = "down"
  773. end
  774. --[[ character below top side and above mid point (upward edge) ]]
  775. if p1.Y.Scale + g1.Size.Y.Scale > p2.Y.Scale and p1.Y.Scale + g1.Size.Y.Scale < p2.Y.Scale + (g2.Size.Y.Scale/2) and (p1.X.Scale+1) < p2.X.Scale + g2.Size.X.Scale and p1.X.Scale + g1.Size.X.Scale > (p2.X.Scale-1) then
  776. col = "up"
  777. end
  778. --[[ left edge ]]
  779. if p1.X.Scale + g1.Size.X.Scale > p2.X.Scale and p1.X.Scale + g1.Size.X.Scale < p2.X.Scale + (g2.Size.X.Scale/2) and (p1.Y.Scale+1) < p2.Y.Scale + g2.Size.Y.Scale and p1.Y.Scale + g1.Size.Y.Scale > (p2.Y.Scale-1) then
  780. col = "left"
  781. end
  782. --[[ right edge ]]
  783. if p1.X.Scale < p2.X.Scale + g2.Size.X.Scale and p1.X.Scale > p2.X.Scale + (g2.Size.X.Scale/2) and (p1.Y.Scale+1) < p2.Y.Scale + g2.Size.Y.Scale and p1.Y.Scale + g1.Size.Y.Scale > (p2.Y.Scale-1) then
  784. col = "right"
  785. end
  786. return col
  787. end
  788.  
  789. local function getTiles(tiletype)
  790. local found = {}
  791. for _,v in pairs(tiles) do
  792. if string.find(v.Name, "tile" ..tostring(tiletype).. "_") then
  793. table.insert(found, v)
  794. end
  795. end
  796. return found
  797. end
  798.  
  799. local function isTile(v, ntile)
  800. if string.find(v.Name, "tile" ..tostring(ntile).. "_") then
  801. return true
  802. else
  803. return false
  804. end
  805. end
  806.  
  807. local function walkAnimation(forward)
  808. walkCounter = walkCounter + 1
  809. if walkCounter > 8 then
  810. walkCounter = 1
  811. end
  812. local playIndex = walkCounter
  813. if walkCounter == 4 then
  814. playIndex = 2
  815. elseif walkCounter == 5 then
  816. playIndex = 1
  817. elseif walkCounter == 6 then
  818. playIndex = 4
  819. elseif walkCounter == 7 then
  820. playIndex = 5
  821. elseif walkCounter == 8 then
  822. playIndex = 4
  823. end
  824. if forward then
  825. char.Image = "http://www.roblox.com/asset/?id=" ..playerWalkForward[playIndex]
  826. else
  827. char.Image = "http://www.roblox.com/asset/?id=" ..playerWalkBackward[playIndex]
  828. end
  829. end
  830.  
  831. local function stopAnimation()
  832. if facing == "right" then
  833. char.Image = "http://www.roblox.com/asset/?id=" ..playerWalkForward[1]
  834. elseif facing == "left" then
  835. char.Image = "http://www.roblox.com/asset/?id=" ..playerWalkBackward[1]
  836. end
  837. end
  838.  
  839. mleft.MouseButton1Down:connect(function()
  840. facing = "left"
  841. movingleft = true
  842. movingright = false
  843. end)
  844. mright.MouseButton1Down:connect(function()
  845. facing = "right"
  846. movingright = true
  847. movingleft = false
  848. end)
  849.  
  850. mleft.MouseButton1Up:connect(function()
  851. if ontablet then
  852. Delay(.8, function() movingleft=false end)
  853. else
  854. movingleft=false
  855. end
  856. end)
  857. mright.MouseButton1Up:connect(function()
  858. if ontablet then
  859. Delay(.8, function() movingright=false end)
  860. else
  861. movingright=false
  862. end
  863. end)
  864.  
  865. btnjump.MouseButton1Down:connect(function()
  866. if platforming == true then
  867. charVelocityY = -jumpheight
  868. platforming = false
  869. end
  870. end)
  871.  
  872. if UserMouse ~= nil then
  873. keydown_con = UserMouse.KeyDown:connect(function(key)
  874. key = key:lower()
  875. if key == "j" then
  876. movingleft = true
  877. movingright = false
  878. facing = "left"
  879. elseif key == "l" then
  880. movingright = true
  881. movingleft = false
  882. facing = "right"
  883. end
  884. if key == "k" and platforming == true then
  885. charVelocityY = -jumpheight
  886. platforming = false
  887. end
  888. end)
  889.  
  890. keyup_con = UserMouse.KeyUp:connect(function(key)
  891. key = key:lower()
  892. if key == "j" then
  893. movingleft = false
  894. end
  895. if key == "l" then
  896. movingright = false
  897. end
  898. end)
  899. end
  900.  
  901. function removeTile(tile)
  902. for i,v in pairs(tiles) do
  903. if v == tile then
  904. table.remove(tiles, i)
  905. tile:Destroy()
  906. end
  907. end
  908. end
  909.  
  910. processing_con = game:GetService("RunService").RenderStepped:connect(function()
  911. if appopened == true then
  912. txtpoints.Text = "pts: " ..points
  913. char.Position = char.Position + UDim2.new(charVelocityX,0,charVelocityY,0)
  914. charxtile = math.ceil(char.Position.X.Scale/tilexsize)
  915. charytile = math.ceil(char.Position.Y.Scale/tileysize)
  916.  
  917. --[[ move screen rather than character ]]
  918. if (movingleft == true) then
  919. for _,v in pairs(tiles) do
  920. v.Position = v.Position + UDim2.new(charspeed,0,0,0)
  921. end
  922. walkAnimation(false)
  923. elseif (movingright == true) then
  924. for _,v in pairs(tiles) do
  925. v.Position = v.Position - UDim2.new(charspeed,0,0,0)
  926. end
  927. walkAnimation(true)
  928. else
  929. stopAnimation()
  930. end
  931.  
  932. for _,v in pairs(getTiles(T)) do
  933. local c = Touching(char, v)
  934. if c ~= "" then
  935. points = points + 100
  936. removeTile(v)
  937. end
  938. end
  939.  
  940. for _,v in pairs(getTiles(K)) do
  941. local c = Touching(char, v)
  942. if c ~= "" then
  943. points = points + 25
  944. holdingKey = true
  945. removeTile(v)
  946. end
  947. end
  948.  
  949. for _,v in pairs(getTiles(D)) do
  950. local c = Touching(char, v)
  951. if c ~= "" then
  952. if holdingKey == true then
  953. removeTile(v)
  954. holdingKey = false
  955. alert(main, "You won! Score: " ..points, 2)
  956. CloseApps(main)
  957. end
  958. end
  959. end
  960.  
  961. for _,v in pairs(getTiles(G)) do
  962. local gd = v:findFirstChild("Direction")
  963. local gs = v:findFirstChild("Steps")
  964. local c = Touching(char, v)
  965. if c == "up" then
  966. removeTile(v)
  967. points = points + 100
  968. return
  969. end
  970. if c == "down" then
  971. char:Destroy()
  972. alert(main, "Game Over.", 2)
  973. Delay(1, function() CloseApps(main) end)
  974. end
  975. if gd ~= nil and gs ~= nil then
  976. if gs.Value > 20 then
  977. gd.Value = "Left"
  978. elseif gs.Value < -20 then
  979. gd.Value = "Right"
  980. end
  981. if gd.Value == "Left" then
  982. gs.Value = gs.Value - 1
  983. elseif gd.Value == "Right" then
  984. gs.Value = gs.Value + 1
  985. end
  986. v.Position = v.Position + UDim2.new(gs.Value*.001,0,0,0)
  987. end
  988. end
  989.  
  990. local set_up = false
  991.  
  992. --[[ add collision detection ]]
  993. for _,v in pairs(tiles) do
  994. if (isTile(v, 1) or isTile(v, 2) or isTile(v, D)) then
  995. local c = Touching(char, v)
  996. if c == "up" then
  997. local set_up = true
  998. charVelocityY = 0
  999. platforming = true
  1000. char.Position = UDim2.new(char.Position.X.Scale,0,(v.Position.Y.Scale-char.Size.Y.Scale),0)
  1001. elseif c == "down" then
  1002. char.Position = char.Position + UDim2.new(0,0,math.abs(charVelocityY),0)
  1003. elseif c == "left" then
  1004. for _,v in pairs(tiles) do
  1005. v.Position = v.Position + UDim2.new(charspeed,0,0,0)
  1006. end
  1007. elseif c == "right" then
  1008. for _,v in pairs(tiles) do
  1009. v.Position = v.Position - UDim2.new(charspeed,0,0,0)
  1010. end
  1011. end
  1012. end
  1013. end
  1014.  
  1015. --[[ apply gravity to character ]]
  1016. if platforming == false or set_up == false then
  1017. if charVelocityY <= vmaxfall then
  1018. charVelocityY = charVelocityY + gravity
  1019. end
  1020. end
  1021. end
  1022. end)
  1023. end
  1024.  
  1025. local function apps_radar()
  1026. alert(main, "left-click=teleport | right-click=explode", 2)
  1027. --[[ Todo: make a radar that shows circles for all objects, and be able to edit them. ]]
  1028. local radar = Instance.new("ImageLabel", appdisplay)
  1029. radar.Image = "http://www.roblox.com/asset/?id=29051010"
  1030. radar.BackgroundTransparency = 1
  1031. radar.Size = UDim2.new(0,300*2,0,300*2)
  1032. radar.ZIndex = (appdisplay.ZIndex+1)
  1033.  
  1034. local objects = {}
  1035. local range = 300*2
  1036. local radarCenter = Vector2.new(290,285)--[[ Vector2.new(140*2,155*2) ]]
  1037.  
  1038. local function clearobjects()
  1039. for _,v in pairs(objects) do
  1040. v:remove()
  1041. end
  1042. objects = {}
  1043. end
  1044.  
  1045. --[[ circle1: http://www.roblox.com/asset/?id=26182897, circle2: http://www.roblox.com/asset/?id=29712145 ]]
  1046. local function createnode(obj, pos, txt)
  1047. local icon = Instance.new("ImageButton", appdisplay)
  1048. if obj.Parent == User.Character then
  1049. icon.Image = "http://www.roblox.com/asset/?id=29712145"
  1050. else
  1051. icon.Image = "http://www.roblox.com/asset/?id=26182897"
  1052. end
  1053. icon.BackgroundTransparency = 1
  1054. icon.Size = UDim2.new(0,35,0,30)
  1055. icon.Position = UDim2.new(0,pos.x,0,pos.y)
  1056. icon.ZIndex = (radar.ZIndex+1)
  1057.  
  1058. local label = Instance.new("TextLabel", icon)
  1059. label.BackgroundTransparency = 1
  1060. label.TextColor3 = Color3.new(1,1,1)
  1061. label.Size = UDim2.new(0,40,0,20)
  1062. label.ZIndex = (icon.ZIndex+1)
  1063. label.FontSize = "Size18"
  1064. label.Text = tostring(txt)
  1065. label.Font = mainfont
  1066. label.Visible = false
  1067.  
  1068. icon.MouseEnter:connect(function() label.Visible=true end)
  1069. icon.MouseLeave:connect(function() label.Visible=false end)
  1070. icon.MouseButton2Down:connect(function() Instance.new("Explosion",game.Workspace).Position=obj.Position end)
  1071. icon.MouseButton1Down:connect(function()
  1072. local t = User.Character:findFirstChild("Torso")
  1073. if t ~= nil then
  1074. obj.Parent:MoveTo(t.Position+Vector3.new(0,3,0))
  1075. end
  1076. end)
  1077.  
  1078. table.insert(objects, label)
  1079. table.insert(objects, icon)
  1080. end
  1081.  
  1082. local function loadobjects()
  1083. local torso = User.Character:findFirstChild("Torso")
  1084. if torso ~= nil then
  1085. for _,v in pairs(game.Players:GetPlayers()) do
  1086. if v.Character ~= nil then
  1087. local playerTorso = v.Character:findFirstChild("Torso")
  1088. if playerTorso ~= nil and playerTorso ~= torso then
  1089. local posDiff = Vector3.new((torso.Position.x-playerTorso.Position.x),0,(torso.Position.z-playerTorso.Position.z))
  1090. if (posDiff.magnitude < range) then
  1091. -- translate coordinates to radar coordinates
  1092. posDiff = Vector2.new((posDiff.x + range) * 0.5,(posDiff.z + range) * 0.5)
  1093.  
  1094. local rotationVector = c_angle.Value
  1095. local denom = math.abs(rotationVector.x) + math.abs(rotationVector.z)
  1096.  
  1097. local xDirect = -(rotationVector.x/denom)
  1098. local zDirect = -(rotationVector.z/denom)
  1099.  
  1100. local angle = math.atan2(1,0) - math.atan2(zDirect,xDirect)
  1101.  
  1102. local point = Vector2.new(((posDiff.x - radarCenter.x) * math.cos(angle)) - ((posDiff.y - radarCenter.y) * math.sin(angle)) + radarCenter.x,((posDiff.x - radarCenter.x) * math.sin(angle)) + ((posDiff.y - radarCenter.y) * math.cos(angle)) + radarCenter.y)
  1103. createnode(playerTorso, point, playerTorso.Parent)
  1104. end
  1105. else
  1106. createnode(playerTorso, radarCenter, playerTorso.Parent)
  1107. end
  1108. end
  1109. end
  1110. end
  1111. end
  1112.  
  1113. processing_con = game:GetService("RunService").RenderStepped:connect(function()
  1114. clearobjects()
  1115. loadobjects()
  1116. end)
  1117. end
  1118.  
  1119. local function apps_imessage()
  1120. local chats = Instance.new("Frame", appdisplay)
  1121. chats.BackgroundTransparency = 1
  1122. chats.Size = UDim2.new(1,0,0.9,0)
  1123. chats.ZIndex = 5
  1124. chats.Name = "ChatList"
  1125.  
  1126. local btnChoosePlayer = Instance.new("TextButton", appdisplay)
  1127. btnChoosePlayer.Modal = ismodal
  1128. btnChoosePlayer.BackgroundColor3 = Color3.new(0,0,0)
  1129. btnChoosePlayer.BorderColor3 = Color3.new(1,1,1)
  1130. btnChoosePlayer.TextColor3 = Color3.new(1,1,1)
  1131. btnChoosePlayer.Size = UDim2.new(.5,0,.1,0)
  1132. btnChoosePlayer.Position = UDim2.new(0,0,1-btnChoosePlayer.Size.Y.Scale,0)
  1133. btnChoosePlayer.FontSize = "Size36"
  1134. btnChoosePlayer.Text = "Player"
  1135. btnChoosePlayer.Font = mainfont
  1136. local btnReply = btnChoosePlayer:Clone()
  1137. btnReply.Position = UDim2.new(btnChoosePlayer.Size.X.Scale,0,1-btnChoosePlayer.Size.Y.Scale,0)
  1138. btnReply.Parent = appdisplay
  1139. btnReply.Text = "Reply"
  1140.  
  1141. local function sendChat(plr, txt)
  1142. if not plr.Character then return end
  1143. local tab = plr.Character:findFirstChild("Tablet")
  1144. if tab ~= nil then
  1145. local curapp = tab:findFirstChild("CurrentApp")
  1146. local iface = tab:findFirstChild("TabletInterface")
  1147. if iface ~= nil and curapp ~= nil then
  1148. local appdis = iface:findFirstChild("AppDisplay")
  1149. if appdis ~= nil and curapp.Value == "iMessage" then
  1150. local chatlist = appdis:findFirstChild("ChatList")
  1151. if chatlist ~= nil then
  1152. local chat = Instance.new("TextLabel", chatlist)
  1153. chat.BackgroundTransparency = 1
  1154. chat.Size = UDim2.new(1,0,0.2,0)
  1155. chat.Position = UDim2.new(0,0,#chatlist:GetChildren()*chat.Size.Y.Scale,0)
  1156. chat.TextColor3 = Color3.new(1,1,1)
  1157. chat.TextWrapped = true
  1158. chat.FontSize = "Size36"
  1159. chat.ZIndex = (chats.ZIndex+1)
  1160. chat.Font = mainfont
  1161. chat.Text = Username.. ": " ..txt
  1162. Delay(6, function()
  1163. for i = 1,10 do
  1164. chat.TextTransparency = chat.TextTransparency + 0.1
  1165. wait()
  1166. end
  1167. chat:Remove()
  1168. end)
  1169. end
  1170. end
  1171. end
  1172. end
  1173. end
  1174.  
  1175. btnChoosePlayer.MouseButton1Down:connect(function()
  1176. local names = {}
  1177. for _,v in pairs(game.Players:GetChildren()) do
  1178. table.insert(names, v.Name)
  1179. end
  1180. listprompt(main, "Choose player:", names, function(pn, i) btnChoosePlayer.Text=pn end)
  1181. end)
  1182.  
  1183. btnReply.MouseButton1Down:connect(function()
  1184. prompt(main, "Enter message:", "", function(msg)
  1185. local p = game.Players:findFirstChild(btnChoosePlayer.Text)
  1186. if p ~= nil then
  1187. sendChat(p, msg)
  1188. else
  1189. alert(main, "Player does not exist", 2)
  1190. end
  1191. end)
  1192. end)
  1193. end
  1194.  
  1195. local function apps_notes()
  1196. --[[ AppStorage.NotesApp.Contents, .Titles ]]
  1197. --[[ top buttons: +, rename, delete, edit ]]
  1198. local currentNote = 0
  1199.  
  1200. local field = Instance.new("TextButton", appdisplay)
  1201. field.Modal = ismodal
  1202. field.BackgroundColor3 = Color3.new(0,0,0)
  1203. field.BorderColor3 = Color3.new(1,1,1)
  1204. field.TextColor3 = Color3.new(1,1,1)
  1205. field.FontSize = "Size36"
  1206. field.Font = mainfont
  1207. field.Size = UDim2.new(1,0,0.9,0)
  1208. field.Position = UDim2.new(0,0,1-field.Size.Y.Scale,0)
  1209. field.TextYAlignment = "Top"
  1210. field.TextXAlignment = "Left"
  1211. field.TextWrapped = true
  1212. field.Text = ""
  1213.  
  1214. local btnNew = Instance.new("TextButton", appdisplay)
  1215. btnNew.Modal = ismodal
  1216. btnNew.BackgroundColor3 = Color3.new(0,0,0)
  1217. btnNew.BorderColor3 = Color3.new(1,1,1)
  1218. btnNew.TextColor3 = Color3.new(1,1,1)
  1219. btnNew.Size = UDim2.new(.1,0,.1,0)
  1220. btnNew.FontSize = "Size36"
  1221. btnNew.Font = mainfont
  1222. btnNew.Text = "+"
  1223. local btnDelete = btnNew:Clone()
  1224. btnDelete.Parent = appdisplay
  1225. btnDelete.FontSize = "Size24"
  1226. btnDelete.Size = UDim2.new(.3,0,.1,0)
  1227. btnDelete.Text = "Delete"
  1228. btnDelete.Position = UDim2.new(btnNew.Size.X.Scale,0,0,0)
  1229. local btnRename = btnDelete:Clone()
  1230. btnRename.Parent = appdisplay
  1231. btnRename.Text = "Rename"
  1232. btnRename.Position = btnDelete.Position + UDim2.new(btnDelete.Size.X.Scale,0,0,0)
  1233. local btnEdit = btnRename:Clone()
  1234. btnEdit.Parent = appdisplay
  1235. btnEdit.Text = "Edit"
  1236. btnEdit.Position = btnRename.Position + UDim2.new(btnRename.Size.X.Scale,0,0,0)
  1237.  
  1238. local function updateText()
  1239. if #AppStorage.NotesApp.Notes > 0 then
  1240. field.Text = AppStore.NotesApp.Contents[currentNote]
  1241. else
  1242. field.Text = ""
  1243. end
  1244. end
  1245.  
  1246. btnEdit.MouseButton1Down:connect(function()
  1247. listprompt(main, "Select note:", AppStorage.NotesApp.Titles, function(s, i)
  1248. currentNote = i
  1249. updateText()
  1250. end)
  1251. end)
  1252.  
  1253. btnNew.MouseButton1Down:connect(function()
  1254. prompt(main, "Enter title:", "", function(input)
  1255. local n = #AppStorage.NotesApp.Notes
  1256. AppStorage.NotesApp.Titles[n+1] = input
  1257. AppStorage.NotesApp.Contents[n+1] = ""
  1258. currentNote = n+1
  1259. AppStorage.NotesApp.Notes = AppStorage.NotesApp.Notes + 1
  1260. updateText()
  1261. end)
  1262. end)
  1263.  
  1264. btnRename.MouseButton1Down:connect(function()
  1265. listprompt(main, "Select note:", AppStorage.NotesApp.Titles, function(s, i)
  1266. prompt(main, "Enter title:", AppStorage.NotesApp.Titles[i], function(input)
  1267. AppStorage.NotesApp.Titles[i] = input
  1268. end)
  1269. end)
  1270. end)
  1271.  
  1272. btnDelete.MouseButton1Down:connect(function()
  1273. listprompt(main, "Select note:", AppStorage.NotesApp.Titles, function(s, i)
  1274. if currentNote == i then
  1275. if currentNote > 0 then
  1276. currentNote = currentNote - 1
  1277. end
  1278. end
  1279. AppStorage.NotesApp.Notes = AppStorage.NotesApp.Notes - 1
  1280. table.remove(AppStorage.NotesApp.Titles, i)
  1281. table.remove(AppStorage.NotesApp.Contents, i)
  1282. updateText()
  1283. end)
  1284. end)
  1285.  
  1286. field.MouseButton1Down:connect(function()
  1287. prompt(main, "Enter text:", field.Text, function(input)
  1288. field.Text = input
  1289. AppStorage.NotesApp.Contents[currentNote] = input
  1290. end)
  1291. end)
  1292. end
  1293.  
  1294. CreateApp(main, "Settings", "25055218", 10.4, apps_settings)
  1295. CreateApp(main, "Calculator", "45545182", 12.2, apps_calculator)
  1296. CreateApp(main, "Mario Bros.", "34311544", 117.5, apps_bloxx)
  1297. CreateApp(main, "Radar", "149177741", 29.3, apps_radar)
  1298. CreateApp(main, "iMessage", "143345407", 19.8, apps_imessage)
  1299. CreateApp(main, "Notes", "143352101", 17, apps_notes)
  1300.  
  1301. local function onProcessData()
  1302. local minutes = math.floor(game.Workspace.DistributedGameTime / 60)
  1303. local hours = math.floor(minutes / 60)
  1304. local seconds = math.floor(game.Workspace.DistributedGameTime % 60)
  1305. if hours < 10 then hours="0" ..hours end
  1306. if minutes < 10 then minutes="0" ..minutes end
  1307. if seconds < 10 then seconds="0" ..seconds end
  1308. TopBanner.Text = hours.. ":" ..minutes.. ":" ..seconds
  1309.  
  1310. local t = User.Character:findFirstChild("Torso")
  1311. if TabletBegun == true and t ~= nil then
  1312. local curcam = game.Workspace.CurrentCamera
  1313. if (curcam ~= nil) then
  1314. c_angle.Value = curcam.CoordinateFrame.lookVector
  1315. --[[curcam.CoordinateFrame = t.CFrame*CFrame.new(0,1.2,5)*CFrame.Angles(xangle,0,0)]]
  1316. end
  1317.  
  1318. if surfing == false then
  1319. handle.CFrame = t.CFrame*CFrame.new(0,1.2,-5)*CFrame.Angles(-xangle,0,0)
  1320. else
  1321. local btn = User.Character:findFirstChild("Toggle")
  1322. if btn ~= nil then
  1323. btn.CFrame=handle.CFrame+Vector3.new(((handle.Size.X/2)-btn.Size.X),(handle.Size.Y/2),-2.5)
  1324. btn.CFrame=btn.CFrame*CFrame.Angles(-xangle,0,0)
  1325. end
  1326. end
  1327. end
  1328. end
  1329.  
  1330. --[[game:GetService("RunService").RenderStepped:connect(onProcessData)]]
  1331. while TabletBegun do wait() onProcessData() end
  1332. end
  1333.  
  1334. function onButton1Down(mouse)
  1335. if btnDown_tabletbegin == nil then return end
  1336.  
  1337. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  1338.  
  1339. btnDown_tabletbegin:disconnect()
  1340. btnDown_tabletbegin = nil
  1341.  
  1342. wait(0.5)
  1343. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1344.  
  1345. handle.Parent = User.Character
  1346. handle.Size = Vector3.new(4,8,0.2)
  1347. handle.Name = "Tablet"
  1348. handle.Anchored = true
  1349. ipad.TextureId = ""
  1350. ipad.Scale = Vector3.new(3.8,5.4,1.4)
  1351. Instance.new("PointLight", handle)
  1352.  
  1353. local btn = Instance.new("Part", User.Character)
  1354. btn.BrickColor = BrickColor.new("Really black")
  1355. btn.Size = Vector3.new(1,1,0)
  1356. btn.Name = "Toggle"
  1357. btn.Anchored = true
  1358. btn.CanCollide = false
  1359. btn.Locked = true
  1360. local btnmesh = Instance.new("BlockMesh", btn)
  1361. btnmesh.Scale = Vector3.new(1.25,0.25,0.25)
  1362. local cd = Instance.new("ClickDetector", btn)
  1363. cd.MouseClick:connect(function(player)
  1364. if player == User then
  1365. if surfing == false then
  1366. surfing = true
  1367. else
  1368. surfing = false
  1369. end
  1370. end
  1371. end)
  1372.  
  1373. Tool:remove()
  1374.  
  1375. TabletBegin()
  1376. end
  1377.  
  1378. function onEquipped(mouse)
  1379. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1380.  
  1381. --[[if game.Workspace.Camera ~= nil then
  1382. game.Workspace.Camera.CameraType = "Scriptable"
  1383. end]]
  1384.  
  1385. btnDown_tabletbegin = mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  1386. end
  1387.  
  1388. function onUnequipped()
  1389. --[[if game.Workspace.Camera ~= nil then
  1390. game.Workspace.Camera.CameraType = oldcam
  1391. end]]
  1392. end
  1393.  
  1394. Tool.Equipped:connect(onEquipped)
  1395. Tool.Unequipped:connect(onUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment