Advertisement
SlyHades66

Final Egg Hunt

Mar 22nd, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.09 KB | None | 0 0
  1. --Fab Teleporter
  2. game.Workspace.Eggs.ChildAdded:connect(function(egg)
  3. if string.match(egg.Name, "Fab") then
  4. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = egg.CFrame
  5. end
  6. end)
  7. wait(0.03)
  8.  
  9. --Eggs
  10. local s = Instance.new("ScreenGui", game.CoreGui)
  11. local f = Instance.new("Frame", s)
  12. f.BackgroundTransparency = 1
  13. f.Position = UDim2.new(0.2,0,0.1,0)
  14. button = Instance.new("TextButton", f)
  15. button.Name = "1"
  16. button.Text = "Teleport Eggs To Player"
  17. button.BackgroundTransparency = 1
  18. button.TextColor3 = Color3.new(255,255,255)
  19. button.Font = "SourceSansBold"
  20. button.FontSize = "Size24"
  21. button.Size = UDim2.new(0,200,0,20)
  22. button.Position = button.Position-UDim2.new(0,55,0,0)
  23.  
  24. button.MouseButton1Down:connect(function()
  25. function g(o)
  26. for i,v in pairs(o:children())do
  27. if v.ClassName == "Part" then
  28. v.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  29. end
  30. g(v)
  31. end
  32. end
  33. pcall(g,game.Workspace.Eggs)
  34. end)
  35.  
  36. local e = 2
  37. local previousvalue = 1
  38. for i,v in pairs(game.Workspace.Eggs:GetChildren()) do
  39. if f:FindFirstChild('1') then
  40. local q = Instance.new("TextButton", f)
  41. q.Size = UDim2.new(0,200,0,20)
  42. q.BackgroundTransparency = 1
  43. if string.match(q.Text, "Fab") then
  44. q.TextColor3 = Color3.new(255,0,0)
  45. else
  46. q.TextColor3 = Color3.new(255,255,255)
  47. end
  48. q.Name = e
  49. q.Text = v.Name
  50. q.Font = "SourceSansBold"
  51. q.FontSize = "Size24"
  52. q.Position = f[previousvalue].Position+UDim2.new(0,0,0,28)
  53. previousvalue = e
  54. e = e+1
  55. end
  56. end
  57.  
  58. game.Workspace.Eggs.ChildAdded:connect(function(player)
  59. for i,v in pairs(f:GetChildren()) do
  60. if v.Name ~= "1" then
  61. v:Destroy()
  62. end
  63. end
  64. local e = 2
  65. local previousvalue = 1
  66. for i,v in pairs(game.Workspace.Eggs:GetChildren()) do
  67. if f:FindFirstChild('1') then
  68. local q = Instance.new("TextButton", f)
  69. q.Size = UDim2.new(0,200,0,20)
  70. q.BackgroundTransparency = 1
  71. if string.match(q.Text, "Fab") then
  72. q.TextColor3 = Color3.new(255,0,0)
  73. else
  74. q.TextColor3 = Color3.new(255,255,255)
  75. end
  76. q.Name = e
  77. q.Text = v.Name
  78. q.Font = "SourceSansBold"
  79. q.FontSize = "Size24"
  80. q.Position = f[previousvalue].Position+UDim2.new(0,0,0,28)
  81. previousvalue = e
  82. e = e+1
  83. end
  84. end
  85. for i,v in pairs(f:GetChildren()) do
  86. if v.Name ~= "1" then
  87. v.MouseButton1Down:connect(function()
  88. function g(o)
  89. for i,c in pairs(o:children())do
  90. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  91. if c.ClassName == "Part" then
  92. wait(0.3)
  93. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  94. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = c.CFrame
  95. end
  96. end
  97. end
  98. g(c)
  99. end
  100. end
  101. pcall(g,game.Workspace.Eggs)
  102. end)
  103. end
  104. end
  105. end)
  106. wait(0.03)
  107. for i,v in pairs(f:GetChildren()) do
  108. if v.Name ~= "1" then
  109. v.MouseButton1Down:connect(function()
  110. function g(o)
  111. for i,c in pairs(o:children())do
  112. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  113. if c.ClassName == "Part" then
  114. wait(0.3)
  115. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  116. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = c.CFrame
  117. end
  118. end
  119. end
  120. g(c)
  121. end
  122. end
  123. pcall(g,game.Workspace.Eggs)
  124. end)
  125. end
  126. end
  127.  
  128. game.Workspace.Eggs.ChildRemoved:connect(function(removed)
  129. for i,v in pairs(f:GetChildren()) do
  130. if v.Name ~= "1" then
  131. v:Destroy()
  132. end
  133. end
  134. local e = 2
  135. local previousvalue = 1
  136. for i,v in pairs(game.Workspace.Eggs:GetChildren()) do
  137. if f:FindFirstChild('1') then
  138. local q = Instance.new("TextButton", f)
  139. q.Size = UDim2.new(0,200,0,20)
  140. q.BackgroundTransparency = 1
  141. if string.match(q.Text, "Fab") then
  142. q.TextColor3 = Color3.new(255,0,0)
  143. else
  144. q.TextColor3 = Color3.new(255,255,255)
  145. end
  146. q.Name = e
  147. q.Text = v.Name
  148. q.Font = "SourceSansBold"
  149. q.FontSize = "Size24"
  150. q.Position = f[previousvalue].Position+UDim2.new(0,0,0,28)
  151. previousvalue = e
  152. e = e+1
  153. end
  154. end
  155. for i,v in pairs(f:GetChildren()) do
  156. if v.Name ~= "1" then
  157. v.MouseButton1Down:connect(function()
  158. function g(o)
  159. for i,c in pairs(o:children())do
  160. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  161. if c.ClassName == "Part" then
  162. wait(0.3)
  163. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  164. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = c.CFrame
  165. end
  166. end
  167. end
  168. g(c)
  169. end
  170. end
  171. pcall(g,game.Workspace.Eggs)
  172. end)
  173. end
  174. end
  175. end)
  176. wait(0.03)
  177. for i,v in pairs(f:GetChildren()) do
  178. if v.Name ~= "1" then
  179. v.MouseButton1Down:connect(function()
  180. function g(o)
  181. for i,c in pairs(o:children())do
  182. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  183. if c.ClassName == "Part" then
  184. wait(0.3)
  185. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  186. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = c.CFrame
  187. end
  188. end
  189. end
  190. g(c)
  191. end
  192. end
  193. pcall(g,game.Workspace.Eggs)
  194. end)
  195. end
  196. end
  197. --Collectibles
  198. wait(3)
  199.  
  200. local s = Instance.new("ScreenGui", game.CoreGui)
  201. local f = Instance.new("Frame", s)
  202. f.BackgroundTransparency = 1
  203. f.Position = UDim2.new(0.8,0,0.1,0)
  204. button = Instance.new("TextButton", f)
  205. button.Name = "1"
  206. button.Text = "Teleport Collectibles To Player"
  207. button.BackgroundTransparency = 1
  208. button.TextColor3 = Color3.new(255,255,255)
  209. button.Font = "SourceSansBold"
  210. button.FontSize = "Size24"
  211. button.Size = UDim2.new(0,200,0,20)
  212. button.Position = button.Position-UDim2.new(0,55,0,0)
  213.  
  214. button.MouseButton1Down:connect(function()
  215. function g(o)
  216. for i,v in pairs(o:children())do
  217. if v.ClassName == "Part" or c.ClassName == "UnionOperation" and c.Transparency == 0 then
  218. v.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  219. end
  220. g(v)
  221. end
  222. end
  223. pcall(g,game.Workspace.CollectibleItems)
  224. end)
  225.  
  226. local e = 2
  227. local previousvalue = 1
  228. for i,v in pairs(game.Workspace.CollectibleItems:GetChildren()) do
  229. if f:FindFirstChild('1') then
  230. local q = Instance.new("TextButton", f)
  231. q.Size = UDim2.new(0,200,0,20)
  232. q.BackgroundTransparency = 1
  233. q.TextColor3 = Color3.new(255,255,255)
  234. q.Name = e
  235. q.Text = v.Name
  236. q.Font = "SourceSansBold"
  237. q.FontSize = "Size24"
  238. q.Position = f[previousvalue].Position+UDim2.new(0,0,0,28)
  239. previousvalue = e
  240. e = e+1
  241. end
  242. end
  243.  
  244. game.Workspace.CollectibleItems.ChildAdded:connect(function(player)
  245. local q = Instance.new("TextButton", f)
  246. q.Size = UDim2.new(0,200,0,20)
  247. q.BackgroundTransparency = 1
  248. q.TextColor3 = Color3.new(255,255,255)
  249. q.Name = e
  250. q.Text = player.Name
  251. q.Font = "SourceSansBold"
  252. q.FontSize = "Size24"
  253. q.Position = f[previousvalue].Position+UDim2.new(0,0,0,28)
  254. previousvalue = e
  255. e = e+1
  256. end)
  257.  
  258. game.Workspace.CollectibleItems.ChildRemoved:connect(function(removed)
  259. for i,v in pairs(f:GetChildren()) do
  260. if v.Name ~= "1" then
  261. v:Destroy()
  262. end
  263. end
  264. wait(0.03)
  265.  
  266. local e = 2
  267. local previousvalue = 1
  268. for i,v in pairs(game.Workspace.CollectibleItems:GetChildren()) do
  269. if f:FindFirstChild('1') then
  270. local q = Instance.new("TextButton", f)
  271. q.Size = UDim2.new(0,200,0,20)
  272. q.BackgroundTransparency = 1
  273. q.TextColor3 = Color3.new(255,255,255)
  274. q.Name = e
  275. q.Text = v.Name
  276. q.Font = "SourceSansBold"
  277. q.FontSize = "Size24"
  278. q.Position = f[previousvalue].Position+UDim2.new(0,0,0,28)
  279. previousvalue = e
  280. e = e+1
  281. end
  282. end
  283. end)
  284.  
  285. for i,v in pairs(f:GetChildren()) do
  286. if v.Name ~= "1" then
  287. v.MouseButton1Down:connect(function()
  288. function g(o)
  289. for i,c in pairs(o:children())do
  290. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  291. if c.ClassName == "Part" or c.ClassName == "UnionOperation" and c.Transparency == 0 then
  292. wait(0.3)
  293. if c.Name == v.Text or c.Parent.Name == v.Text or c.Parent.Parent.Name == v.Text or c.Parent.Parent.Parent.Name == v.Text then
  294. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = c.CFrame
  295. end
  296. end
  297. end
  298. g(c)
  299. end
  300. end
  301. pcall(g,game.Workspace.CollectibleItems)
  302. end)
  303. end
  304. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement