Advertisement
IHATEMICROWAVEOVEN

dogpoop or-gate in evo

Nov 19th, 2023
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.88 KB | None | 0 0
  1. local function ExecuteEvolveLoading()
  2. local currentevolvelevel = curevolvelvl
  3. local curevolve = ""
  4. function LoadEv(name)
  5. curevolve = name
  6. script.Parent.Evolves.pname.Text = name
  7. script.Parent.Evolves.needs.Text = "Needs:\n"
  8. for _, i in pairs(script.Parent.Evolves:GetChildren()) do if i:IsA'TextButton' and i.Name ~= "Exit" and i.Name ~= "evolve" then
  9. i.BorderSizePixel = 3
  10. i.ZIndex = 3
  11. if i.Name == name then
  12. i.BorderSizePixel = 0
  13. i.ZIndex = 2
  14. end
  15. end end
  16. local decoded = nil
  17. if curdir:FindFirstChild("Evolves") then
  18. if curdir.Evolves:FindFirstChild(curevolve) then
  19. if curdir.Evolves[curevolve]:FindFirstChild("Need") then
  20. decoded = mod(curdir.Evolves[curevolve].Need.Value)
  21. end
  22. end
  23. else
  24. if curdir:FindFirstChild(curevolve) then
  25. if curdir[curevolve]:FindFirstChild("Need") then
  26. decoded = mod(curdir[curevolve].Need.Value)
  27. end
  28. end
  29. end
  30. if decoded ~= nil then
  31. for _, i in pairs(decoded) do
  32. if i[1] == "LVL" then
  33. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. i[2] .. " Level"
  34. elseif i[1] == "C" then
  35. for id, v in pairs(mod2(i[2])) do
  36. if id ~= 1 then
  37. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " or "
  38. end
  39. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. v .. " x" .. i[3]
  40. end
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. elseif i[1] == "ORLVL" then
  54. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "OR\n" .. i[2] .. " Level"
  55. elseif i[1] == "OR" then
  56. for id, v in pairs(mod2(i[2])) do
  57. if id ~= 1 then
  58. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " or "
  59. else
  60. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "OR\n"
  61. end
  62. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. v .. " x" .. i[3]
  63. end
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. elseif i[1] == "T" then
  79. for id, v in pairs(mod2(i[2])) do
  80. if id ~= 1 then
  81. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " or "
  82. end
  83. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. v .. " x" .. i[3]
  84. end
  85. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " (will be taken)"
  86. elseif i[1] == "DAY" then
  87. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "Day needed"
  88. elseif i[1] == "NIGHT" then
  89. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "Night needed"
  90. end
  91. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "\n"
  92. end
  93. else
  94. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "No needs"
  95. end
  96. end
  97. local debounce = true
  98. script.Parent.Evolves.evolve.MouseButton1Click:connect(function()
  99. if debounce == true then
  100. debounce = false
  101. -- EVOLVING FUNCTION
  102. if currentevolvelevel == curevolvelvl and curevolve ~= nil and curevolve ~= "" then
  103. local canevolve = true
  104. local decoded = nil
  105. local mega = false
  106. local randback = false
  107. if curevolve ~= "Random" and curevolve ~= "Back" then
  108. if curdir:FindFirstChild("Evolves") then
  109. if curdir.Evolves:FindFirstChild(curevolve) then
  110. if curdir.Evolves[curevolve]:FindFirstChild("MegaEvolution") then
  111. mega = true
  112. end
  113. if curdir.Evolves[curevolve]:FindFirstChild("Need") then
  114. decoded = mod(curdir.Evolves[curevolve].Need.Value)
  115. end
  116. end
  117. else
  118. if curdir:FindFirstChild(curevolve) then
  119. if curdir[curevolve]:FindFirstChild("MegaEvolution") then
  120. mega = true
  121. end
  122. if curdir[curevolve]:FindFirstChild("Need") then
  123. decoded = mod(curdir[curevolve].Need.Value)
  124. end
  125. end
  126. end
  127. if decoded ~= nil then
  128. for _, i in pairs(decoded) do
  129. if i[1] == "LVL" then
  130. if CallServer("GetLVL") < tonumber(i[2]) then
  131. canevolve = false
  132. end
  133. elseif i[1] == "C" then
  134. local passed = false
  135. for id, v in pairs(mod2(i[2])) do
  136. if Stats.GetStat(v) >= tonumber(i[3]) then
  137. passed = true
  138. end
  139. end
  140. if not passed then canevolve = false end
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. elseif i[1] == "ORLVL" then
  158. if CallServer("GetLVL") < tonumber(i[2]) then
  159. canevolve = canevolve or false
  160. end
  161. elseif i[1] == "OR" then
  162. local passed = false
  163. for id, v in pairs(mod2(i[2])) do
  164. if Stats.GetStat(v) >= tonumber(i[3]) then
  165. passed = true
  166. end
  167. end
  168. canevolve = canevolve or passed -- resets to true if it succeeds
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. elseif i[1] == "T" then
  191. local passed = false
  192. for id, v in pairs(mod2(i[2])) do
  193. if Stats.GetStat(v) >= tonumber(i[3]) then
  194. passed = true
  195. end
  196. end
  197. if not passed then canevolve = false end
  198. elseif i[1] == "DAY" then
  199. if CallServer("DayNight") ~= "D" then
  200. canevolve = false
  201. end
  202. elseif i[1] == "NIGHT" then
  203. if CallServer("DayNight") ~= "N" then
  204. canevolve = false
  205. end
  206. end
  207. end
  208. end
  209. elseif curevolve == "Back" then
  210. if curdir:FindFirstChild("Evolves") then
  211. if curdir.Evolves:FindFirstChild("Random") then
  212. randback = true
  213. end
  214. else
  215. if curdir:FindFirstChild("Random") then
  216. randback = true
  217. end
  218. end
  219. end
  220. -- EVOLVE REQUIREMENTS CHECK
  221. if canevolve then
  222. local evolved = nil
  223. if not mega then
  224. if curevolve == "Back" then
  225. if randback then
  226. evolved = CallServer("Evolve", curdir.Name)
  227. else
  228. evolved = CallServer("Evolve", FindPreviousPokemon(curdir).Name)
  229. end
  230. else
  231. evolved = CallServer("Evolve", curevolve)
  232. end
  233. else
  234. evolved = CallServer("MegaEvolve", curevolve)
  235. end
  236. if evolved then
  237. -- TAKING ITEMS
  238. if curevolve ~= "Random" and curevolve ~= "Back" then
  239. if decoded ~= nil then
  240. for _, i in pairs(decoded) do
  241. if i[1] == "T" then
  242. for id, v in pairs(mod2(i[2])) do
  243. if Stats.GetStat(v) >= tonumber(i[3]) then
  244. CallServer("ChangeStat", v, Stats.GetStat(v) - tonumber(i[3]))
  245. break
  246. end
  247. end
  248. end
  249. end
  250. end
  251. end
  252. if curevolve ~= "Random" and curevolve ~= "Back" then
  253. script.Parent.InfoBar:FindFirstChild("Name").Text = curevolve
  254. elseif curevolve == "Back" and not randback then
  255. script.Parent.InfoBar:FindFirstChild("Name").Text = FindPreviousPokemon(curdir).Name
  256. end
  257. script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  258. script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  259. openedframe = ""
  260. curevolvelvl = curevolvelvl + 1
  261. if curevolve ~= "Random" and curevolve ~= "Back" and not mega then
  262. if curdir:FindFirstChild("Evolves") then
  263. curdir = curdir.Evolves:FindFirstChild(curevolve)
  264. elseif curdir:FindFirstChild(curevolve) then
  265. curdir = curdir:FindFirstChild(curevolve)
  266. end
  267. elseif curevolve == "Back" and not randback then
  268. curdir = FindPreviousPokemon(curdir)
  269. end
  270. script.Parent.Evolves.needs.Text = "Needs:"
  271. script.Parent.Evolves.pname.Text = "Choose an evolution!"
  272. if curevolve == "Random" then
  273. alreadyevolved = true
  274. elseif curevolve == "Back" and randback then
  275. alreadyevolved = false
  276. end
  277. local tl = nil
  278. if mega then
  279. tl = Instance.new("TextLabel", script.Parent)
  280. tl.Position = UDim2.new(0.7, 0, 1, 0)
  281. tl.Size = UDim2.new(0.3, 0, 0.05, 0)
  282. tl.BackgroundTransparency = 1
  283. tl.TextColor3 = Color3.new(1,1,1)
  284. tl.TextScaled = true
  285. tl.Text = "De-evolving in 180 seconds!"
  286. tl:TweenPosition(UDim2.new(0.7, 0, 0.95, 0), "Out", "Quad", 1, true)
  287. end
  288. local towait = mega == true and 180 or 10
  289. while towait ~= 0 do
  290. if tl then tl.Text = "De-evolving in "..tostring(towait).." seconds!" end
  291. script.Parent.InfoBar.Evolve.Text = "Wait "..tostring(mega and towait + 120 or towait).." seconds"
  292. towait = towait - 1
  293. wait(1)
  294. end
  295. if tl then tl:TweenPosition(UDim2.new(0.7, 0, 1, 0), "Out", "Quad", 1, true, function() tl:Destroy() end) end
  296.  
  297. if mega then
  298. CallServer("Evolve", curdir.Name, 1)
  299. script.Parent.InfoBar:FindFirstChild("Name").Text = curdir.Name
  300. towait = 120
  301. while towait ~= 0 do
  302. script.Parent.InfoBar.Evolve.Text = "Wait "..tostring(towait).." seconds"
  303. towait = towait - 1
  304. wait(1)
  305. end
  306. end
  307. script.Parent.InfoBar.Evolve.Text = "Evolve"
  308. ExecuteEvolveLoading()
  309. end
  310. end
  311. end
  312. debounce = true
  313. end
  314. end)
  315. -- GETTING LIST OF EVOS
  316. local tab = {} -- EVOS
  317. if curdir:FindFirstChild("Evolves") then
  318. for _, i in pairs(curdir.Evolves:GetChildren()) do
  319. if i.Name == "Random" then
  320. table.insert(tab, {Name = "Random"})
  321. if alreadyevolved then
  322. table.insert(tab, {Name = "Back"})
  323. end
  324. else
  325. table.insert(tab, i)
  326. end
  327. end
  328. else
  329. for _, i in pairs(curdir:GetChildren()) do
  330. if i:IsA'Folder' and i.Name ~= "SetStatsOnSpawn" and i.Name ~= "Weapons" and i.Name ~= "Spawns" then
  331. if i.Name == "Random" then
  332. table.insert(tab, {Name = "Random"})
  333. if alreadyevolved then
  334. table.insert(tab, {Name = "Back"})
  335. end
  336. else
  337. table.insert(tab, i)
  338. end
  339. end
  340. end
  341. end
  342.  
  343. for _, i in pairs(script.Parent.Evolves:GetChildren()) do if i:IsA'TextButton' and i.Name ~= "evolve" and i.Name ~= "Exit" then i:Destroy() end end
  344. local X = 0
  345. if #tab ~= 0 then X = 1 / #tab end
  346. for num, i in pairs(tab) do
  347. local but = Instance.new("TextButton", script.Parent.Evolves)
  348. but.Name = i.Name
  349. but.Transparency = 0
  350. but.BackgroundColor3 = Color3.new(65/255, 65/255, 65/255)
  351. but.BorderSizePixel = 3
  352. but.BorderColor3 = Color3.new(0, 0, 0)
  353. but.Font = Enum.Font.SourceSansBold
  354. but.Text = i.Name
  355. but.TextColor3 = Color3.new(1, 1, 1)
  356. but.TextScaled = true
  357. but.Size = UDim2.new(X, 0, 0.1, 0)
  358. but.Position = UDim2.new((num - 1) * X, 0, 0, 0)
  359. but.ZIndex = 2
  360. -- FUNCTIONS
  361. but.MouseButton1Click:connect(function() LoadEv(i.Name) end)
  362. end
  363. if tab[1] ~= nil then
  364. LoadEv(tab[1].Name)
  365. end
  366. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement