Advertisement
popster12345

Untitled

Feb 22nd, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. Objects3D = {"Part", "TrussPart", "WedgePart", "Seat", "VehicleSeat"}
  2.  
  3. function ResetList()
  4. if script.Parent.Parent.SelectedObject.Value == nil then
  5. script.Parent.Parent.SelectedObject.Value = game
  6. end
  7. if script.Parent.Parent.SelectedObject.Value.Name == "Explorer/PropertiesGui" and script.Parent.Parent.SelectedObject.Value.className == "ScreenGui" then
  8. if script.Parent.Parent.SelectedObject.Value.Parent.className == "PlayerGui" or script.Parent.Parent.SelectedObject.Value.Parent == game.StarterGui then
  9. script.Parent.Parent.SelectedObject.Value = script.Parent.Parent.SelectedObject.Value.Parent
  10. end
  11. end
  12. local list = script.Parent:children()
  13. for i = 1, #list do
  14. local Val = list[i]:findFirstChild("Value")
  15. if Val ~= nil then
  16. if Val.Value == "Deleteable" then
  17. list[i]:remove()
  18. end
  19. end
  20. end
  21. if script.Parent.Show.Value == true then
  22. Selectable = nil
  23. for i = 1, #Objects3D do
  24. if script.Parent.Parent.SelectedObject.Value.className == Objects3D[i] then
  25. Selectable = script.Parent.Parent.SelectedObject.Value
  26. end
  27. end
  28. script.Parent.SelectionBox.Adornee = Selectable
  29. script.Parent.SelectionPartLasso.Part = Selectable
  30. script.Parent.SelectionPartLasso.Humanoid = script.Parent.Parent.Parent.Parent.Character:findFirstChild("Humanoid") or script.Parent.Parent.Parent.Parent.Character:findFirstChild("Zombie")
  31. local list2 = script.Parent.Parent.SelectedObject.Value:children()
  32. local new = Instance.new("TextButton")
  33. local new2 = Instance.new("StringValue")
  34. local new7 = Instance.new("ObjectValue")
  35. local new8 = script.ClickSelect:clone()
  36. local Num = #list2
  37. local Num2 = 100
  38. local Num3 = 1
  39. new.Parent = script.Parent
  40. new2.Parent = new
  41. new7.Parent = new
  42. new8.Parent = new
  43. new7.Name = "Object"
  44. new7.Value = script.Parent.Parent.SelectedObject.Value.Parent
  45. new.Text = script.Parent.Parent.SelectedObject.Value.Name
  46. new2.Value = "Deleteable"
  47. new.TextXAlignment = Enum.TextXAlignment.Left
  48. new.Position = UDim2.new(0,20,0,30)
  49. new.Size = UDim2.new(0,#script.Parent.Parent.SelectedObject.Value.Name*6,0,15)
  50. new.BackgroundTransparency = 1
  51. new.BorderSizePixel = 0
  52. if (#script.Parent.Parent.SelectedObject.Value.Name*6)+20 > Num2 then
  53. Num2 = (#script.Parent.Parent.SelectedObject.Value.Name*6)+20
  54. end
  55. for i = 1, Num do
  56. if list2[i] ~= nil then
  57. if script.Parent.Parent.SelectedObject.Value == game then
  58. if list2[i] == game.Workspace or list2[i] == game.Players or list2[i] == game.Lighting or list2[i] == game.StarterGui or list2[i] == game.StarterPack or list2[i] == game.Debris or list2[i] == game.SoundService then
  59. local new3 = Instance.new("TextButton")
  60. local new4 = Instance.new("StringValue")
  61. local new5 = Instance.new("ObjectValue")
  62. local new6 = script.ClickSelect:clone()
  63. new3.Parent = script.Parent
  64. new4.Parent = new3
  65. new5.Parent = new3
  66. new6.Parent = new3
  67. new3.Text = list2[i].Name
  68. new4.Value = "Deleteable"
  69. new5.Value = list2[i]
  70. new3.TextXAlignment = Enum.TextXAlignment.Left
  71. new3.Position = UDim2.new(0,40,0,30+(Num3*15))
  72. Num = Num3
  73. Num3 = Num3+1
  74. new3.Size = UDim2.new(0,#list2[i].Name*6,0,15)
  75. new3.BackgroundTransparency = 1
  76. new3.BorderSizePixel = 0
  77. new5.Name = "Object"
  78. if (#list2[i].Name*6)+40 > Num2 then
  79. Num2 = (#list2[i].Name*6)+40
  80. end
  81. end
  82. else
  83. local new3 = Instance.new("TextButton")
  84. local new4 = Instance.new("StringValue")
  85. local new5 = Instance.new("ObjectValue")
  86. local new6 = script.ClickSelect:clone()
  87. new3.Parent = script.Parent
  88. new4.Parent = new3
  89. new5.Parent = new3
  90. new6.Parent = new3
  91. new3.Text = list2[i].Name
  92. new4.Value = "Deleteable"
  93. new5.Value = list2[i]
  94. new3.TextXAlignment = Enum.TextXAlignment.Left
  95. new3.Position = UDim2.new(0,40,0,30+(i*15))
  96. new3.Size = UDim2.new(0,#list2[i].Name*6,0,15)
  97. new3.BackgroundTransparency = 1
  98. new3.BorderSizePixel = 0
  99. new5.Name = "Object"
  100. if (#list2[i].Name*6)+40 > Num2 then
  101. Num2 = (#list2[i].Name*6)+40
  102. end
  103. end
  104. end
  105. end
  106. script.Parent.Size = UDim2.new(0,Num2,0,50+(Num*15))
  107. end
  108. end
  109.  
  110. script.Parent.Parent.SelectedObject.Changed:connect(ResetList)
  111. script.Parent.Show.Changed:connect(ResetList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement