Advertisement
xTentaci

Untitled

Feb 17th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.82 KB | None | 0 0
  1. local event = game.ReplicatedStorage:WaitForChild("KeyBind")
  2. function event:OnServerInvoke(Player, tier,key)
  3. local suffixes = {'','K','M','B','T','qd','Qn','sx','Sp','O','N','de','Ud','DD','tdD','qdD','QnD','sxD','SpD','OcD','NvD','Vgn','UVg','DVg','TVg','qtV','QnV','SeV','SPG','OVG','NVG','TGN','UTG','DTG','tsTG','qtTG','QnTG','ssTG','SpTG','OcTG','NoAG','UnAG','DuAG','TeAG','QdAG','QnAG','SxAG','SpAG','OcAG','NvAG','CT'}
  4. local function format(val)
  5. for i=1, #suffixes do
  6. if tonumber(val) < 10^(i*3) then
  7. return math.floor(val/((10^((i-1)*3))/100))/(100)..suffixes[i]
  8. end
  9. end
  10. end
  11. local id = 6172708 --// GAMEPASS ID, + 30 SLOTS
  12. local TS = game:GetService("TweenService")
  13. local RS = game:GetService("ReplicatedStorage")
  14. local Library = RS:WaitForChild("View")
  15. local Eggs = require(RS:WaitForChild("Eggs"))
  16. local Data = Eggs[tostring(tier)]
  17. local module = require(game.ReplicatedStorage:WaitForChild("PETS"))
  18. local Cost = Data["Cost"]
  19. local Pets = Data["Pets"]
  20. local Tier = script.Parent:WaitForChild(tostring(tier))
  21. local Egg = Tier:WaitForChild("Egg")
  22. local TotalWeight = 0
  23. for i,v in pairs(Pets) do
  24. TotalWeight = TotalWeight + v[1]
  25. end
  26. local function RotateTween(Obj,Rot)
  27. local TI = TweenInfo.new(.1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
  28. local Propertiers = {
  29. Rotation = Rot
  30. }
  31. local Tween = TS:Create(Obj,TI,Propertiers)
  32. Tween:Play()
  33. end
  34. local function ChoosePet(Player)
  35. local Chance = math.random(1,TotalWeight)
  36. local Counter = 0
  37. for i,v in pairs(Pets) do
  38. Counter = Counter+v[1]
  39. if Chance <= Counter then
  40. return i
  41. end
  42. end
  43. end
  44. if key == true then
  45. local Stats = Player:WaitForChild("leaderstats")
  46. local Coins = Stats:WaitForChild("Coins")
  47. local PetInv = Player:WaitForChild("Pets")
  48. local IndexInv = Player:WaitForChild("Index")
  49. if Player:FindFirstChild("DebPet") then return end
  50. local Counter = 0
  51. for i,v in pairs(PetInv:GetChildren()) do
  52. Counter=Counter+v.Value
  53. end
  54. if Coins.Value >= Cost*3 then
  55. if Counter >= 50 and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, id) then
  56. local GUI = Instance.new("ScreenGui")
  57. local PN = script:WaitForChild("Full"):Clone()
  58. PN.Parent = GUI
  59. GUI.Parent = Player:WaitForChild("PlayerGui")
  60. wait(2)
  61. GUI:Destroy()
  62. elseif Counter >= 20 and not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, id) then
  63. local GUI = Instance.new("ScreenGui")
  64. local PN = script:WaitForChild("Full"):Clone()
  65. PN.Parent = GUI
  66. GUI.Parent = Player:WaitForChild("PlayerGui")
  67. wait(2)
  68. GUI:Destroy()
  69. elseif Counter <= 17 and not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, id) or Counter <= 47 and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, id) then
  70. local debounce = Instance.new("BoolValue")
  71. debounce.Name = "DebPet"
  72. debounce.Parent = Player
  73. Coins.Value = Coins.Value - Cost*3
  74. local PetChosen1,PetChosen2,PetChosen3 = ChoosePet(Player),ChoosePet(Player),ChoosePet(Player)
  75. local GUI = Instance.new("ScreenGui")
  76. local ViewPort1,ViewPort2,ViewPort3 = Instance.new("ViewportFrame"),Instance.new("ViewportFrame"),Instance.new("ViewportFrame")
  77. local PetInv = Player:WaitForChild("Pets")
  78. PetInv:WaitForChild(PetChosen1).Value = PetInv:WaitForChild(PetChosen1).Value +1 IndexInv:WaitForChild(PetChosen1).Value = true
  79. PetInv:WaitForChild(PetChosen2).Value = PetInv:WaitForChild(PetChosen2).Value +1 IndexInv:WaitForChild(PetChosen2).Value = true
  80. PetInv:WaitForChild(PetChosen3).Value = PetInv:WaitForChild(PetChosen3).Value +1 IndexInv:WaitForChild(PetChosen3).Value = true
  81. ViewPort1.Size = UDim2.new(0,260,0,354)ViewPort2.Size = UDim2.new(0,282,0,354)ViewPort3.Size = UDim2.new(0,260,0,354)
  82. ViewPort1.Position,ViewPort2.Position = UDim2.new(0.333,0,0,0),UDim2.new(0.653,0,0,0)
  83. ViewPort1.BackgroundTransparency = 1 ViewPort2.BackgroundTransparency = 1 ViewPort3.BackgroundTransparency = 1
  84. local EggClone1,EggClone2,EggClone3 = Egg:Clone(),Egg:Clone(),Egg:Clone()
  85. local Pos1,Pos2,Pos3 = EggClone1.Position,EggClone2.Position,EggClone3.Position
  86. EggClone1.Parent,EggClone2.Parent,EggClone3.Parent = ViewPort1,ViewPort2,ViewPort3
  87. local Camera1,Camera2,Camera3 = Instance.new("Camera"),Instance.new("Camera"),Instance.new("Camera")
  88. Camera1.Parent,Camera2.Parent,Camera3.Parent = ViewPort1,ViewPort2,ViewPort3
  89. ViewPort1.CurrentCamera,ViewPort2.CurrentCamera,ViewPort3.CurrentCamera = Camera1,Camera2,Camera3
  90. Camera1.CFrame,Camera2.CFrame,Camera3.CFrame = CFrame.new(Vector3.new(Pos1.X,Pos1.Y,Pos1.Z+7),Pos1),CFrame.new(Vector3.new(Pos2.X,Pos2.Y,Pos2.Z+7),Pos2),CFrame.new(Vector3.new(Pos3.X,Pos3.Y,Pos3.Z+7),Pos3)
  91. local pn1,pn2,pn3 = script:WaitForChild("Effect"):Clone(),script:WaitForChild("Effect"):Clone(),script:WaitForChild("Effect"):Clone()
  92. local module = require(game.ReplicatedStorage:WaitForChild("PETS"))
  93. local nm1,nm2,nm3 = script:WaitForChild("NOME"):Clone(),script:WaitForChild("NOME"):Clone(),script:WaitForChild("NOME"):Clone()
  94. nm1.Text,nm2.Text,nm3.Text = module.Pets[tonumber(PetChosen1)],module.Pets[tonumber(PetChosen2)],module.Pets[tonumber(PetChosen3)]
  95. ViewPort1.Parent = GUI ViewPort2.Parent = GUI ViewPort3.Parent = GUI
  96. GUI.Parent = Player:WaitForChild("PlayerGui")
  97. wait(1)
  98. for i=1,5 do
  99. RotateTween(ViewPort1,25)
  100. RotateTween(ViewPort2,25)
  101. RotateTween(ViewPort3,25)
  102. wait(.1)
  103. RotateTween(ViewPort1,-25)
  104. RotateTween(ViewPort2,-25)
  105. RotateTween(ViewPort3,-25)
  106. wait(.1)
  107. end
  108. RotateTween(ViewPort1,0)
  109. RotateTween(ViewPort2,0)
  110. RotateTween(ViewPort3,0)
  111. wait(.5)
  112. EggClone1:Destroy() EggClone2:Destroy() EggClone3:Destroy()
  113. nm1.Parent,nm2.Parent,nm3.Parent = ViewPort1,ViewPort2,ViewPort3
  114. pn1.Parent,pn2.Parent,pn3.Parent = ViewPort1,ViewPort2,ViewPort3
  115. local PetClone1,PetClone2,PetClone3 = Library:WaitForChild(PetChosen1):Clone(),Library:WaitForChild(PetChosen2):Clone(),Library:WaitForChild(PetChosen3):Clone()
  116. local HeadPos1,HeadPos2,HeadPos3 = PetClone1.Position,PetClone2.Position,PetClone3.Position
  117. Camera1.CFrame = CFrame.new(Vector3.new(HeadPos1.X,HeadPos1.Y,HeadPos1.Z+7),HeadPos1) Camera2.CFrame = CFrame.new(Vector3.new(HeadPos2.X,HeadPos2.Y,HeadPos2.Z+7),HeadPos2) Camera3.CFrame = CFrame.new(Vector3.new(HeadPos3.X,HeadPos3.Y,HeadPos3.Z+7),HeadPos3)
  118. PetClone1.Parent,PetClone2.Parent,PetClone3.Parent = ViewPort1,ViewPort2,ViewPort3
  119. wait(2)
  120. GUI:Destroy()
  121. debounce:Destroy()
  122. else
  123. local GUI = Instance.new("ScreenGui")
  124. local PN = script:WaitForChild("3pet"):Clone()
  125. PN.Parent = GUI
  126. GUI.Parent = Player:WaitForChild("PlayerGui")
  127. wait(2)
  128. GUI:Destroy()
  129. end
  130. else
  131. local GUI = Instance.new("ScreenGui")
  132. local PN = script:WaitForChild("NoCoins"):Clone()
  133. PN.Parent = GUI
  134. GUI.Parent = Player:WaitForChild("PlayerGui")
  135. wait(2)
  136. GUI:Destroy()
  137. end
  138. else
  139. local Stats = Player:WaitForChild("leaderstats")
  140. local Coins = Stats:WaitForChild("Coins")
  141. local IndexInv = Player:WaitForChild("Index")
  142. local PetInv = Player:WaitForChild("Pets")
  143. if Player:FindFirstChild("DebPet") then return end
  144. local Counter = 0
  145. for i,v in pairs(PetInv:GetChildren()) do
  146. Counter=Counter+v.Value
  147. end
  148. if Coins.Value >= Cost then
  149. if Counter >= 50 and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, id) then
  150. local GUI = Instance.new("ScreenGui")
  151. local PN = script:WaitForChild("Full"):Clone()
  152. PN.Parent = GUI
  153. GUI.Parent = Player:WaitForChild("PlayerGui")
  154. wait(2)
  155. GUI:Destroy()
  156. elseif Counter >= 20 and not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, id) then
  157. local GUI = Instance.new("ScreenGui")
  158. local PN = script:WaitForChild("Full"):Clone()
  159. PN.Parent = GUI
  160. GUI.Parent = Player:WaitForChild("PlayerGui")
  161. wait(2)
  162. GUI:Destroy()
  163. else
  164. local debounce = Instance.new("BoolValue")
  165. debounce.Name = "DebPet"
  166. debounce.Parent = Player
  167. Coins.Value = Coins.Value - Cost
  168. local PetChosen = ChoosePet(Player)
  169. local GUI = Instance.new("ScreenGui")
  170. local ViewPort = Instance.new("ViewportFrame")
  171. local PetInv = Player:WaitForChild("Pets")
  172. PetInv:WaitForChild(PetChosen).Value = PetInv:WaitForChild(PetChosen).Value +1 IndexInv:WaitForChild(PetChosen).Value = true
  173. ViewPort.Size = UDim2.new(1,0,1,0)
  174. ViewPort.BackgroundTransparency = 1
  175. local EggClone = Egg:Clone()
  176. local Pos = EggClone.Position
  177. EggClone.Parent = ViewPort
  178. local Camera = Instance.new("Camera")
  179. Camera.Parent = ViewPort
  180. ViewPort.CurrentCamera = Camera
  181. Camera.CFrame = CFrame.new(Vector3.new(Pos.X,Pos.Y,Pos.Z+7),Pos)
  182. local pn = script:WaitForChild("Effect"):Clone()
  183. local module = require(game.ReplicatedStorage:WaitForChild("PETS"))
  184. local nm = script:WaitForChild("NOME"):Clone()
  185. nm.Text = module.Pets[tonumber(PetChosen)]
  186. ViewPort.Parent = GUI
  187. GUI.Parent = Player:WaitForChild("PlayerGui")
  188. wait(1)
  189. for i=1,5 do
  190. RotateTween(ViewPort,25)
  191. wait(.1)
  192. RotateTween(ViewPort,-25)
  193. wait(.1)
  194. end
  195. RotateTween(ViewPort,0)
  196. wait(.5)
  197. EggClone:Destroy()
  198. nm.Parent = GUI
  199. pn.Visible = true
  200. pn.Parent = ViewPort
  201. local PetClone = Library:WaitForChild(PetChosen):Clone()
  202. local HeadPos = PetClone.Position
  203. Camera.CFrame = CFrame.new(Vector3.new(HeadPos.X,HeadPos.Y,HeadPos.Z+7),HeadPos)
  204. PetClone.Parent = ViewPort
  205. wait(2)
  206. GUI:Destroy()
  207. debounce:Destroy()
  208. end
  209. else
  210. local GUI = Instance.new("ScreenGui")
  211. local PN = script:WaitForChild("NoCoins"):Clone()
  212. PN.Parent = GUI
  213. GUI.Parent = Player:WaitForChild("PlayerGui")
  214. wait(2)
  215. GUI:Destroy()
  216. end
  217. end
  218. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement