jayrock3401

Untitled

Aug 7th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.05 KB | None | 0 0
  1.  
  2.  
  3. function createPortal()
  4. local portal=Instance.new("Model", workspace:FindFirstChild"Base" or workspace)
  5. local portalPart=Instance.new("Part", portal)
  6. portalPart.FormFactor="Custom"
  7. portalPart.Size=Vector3.new(10, 1, 10)
  8. portalPart.Position=Vector3.new(0, 500, 0)
  9. Instance.new("CylinderMesh", portalPart).Scale=Vector3.new(1, .001, 1)
  10. portalPart.BrickColor=BrickColor.new"Bright blue"
  11. portalPart.Name="Portal"
  12. portalPart.Anchored=true
  13. portalPart.CanCollide=false
  14. portal.PrimaryPart=portalPart
  15. portalPart.Material="Sand"
  16. portalPart.Transparency=.1
  17.  
  18. return portal
  19. end
  20. function getPlayer(pname)
  21. if type(pname)~="string" then
  22. pname=pname.Name
  23. end
  24. for _, p in ipairs(game:GetService"Players":GetPlayers()) do
  25. if p.Name:lower():match("^"..pname:lower()) then
  26. return p
  27. end
  28. end
  29. end
  30. local http=game:GetService'HttpService'
  31. function getservers()
  32. return http:JSONDecode(http:PostAsync("https://us4.proxysite.com/includes/process.php?action=update","server-option=us3&d="..http:UrlEncode("http://www.roblox.com/games/getgameinstancesjson?placeId=20279777&startindex=0"),Enum.HttpContentType.ApplicationUrlEncoded))
  33. end
  34. do
  35. local cache=nil
  36. function getServers(cached)
  37. if not cached then
  38. if not cache then
  39. cache=getservers()
  40. end
  41. return cache
  42. else
  43. cache=getservers()
  44. return cache
  45. end
  46.  
  47. end
  48.  
  49. end
  50. function recurse(level, tbl)
  51. for k, v in pairs(tbl) do
  52. print(('\t'):rep(level)..tostring(k)..":"..tostring(v))
  53. if type(v)=="table" then
  54. recurse(level+1, v)
  55. end
  56. end
  57. end
  58. local function computeGUIDhash(str)
  59. local hash=1337
  60. for match in str:gmatch(".") do
  61. hash=hash*23+string.byte(match)
  62. end
  63. return hash
  64. end
  65.  
  66. listservers=function()
  67. local servers=getServers(true)
  68.  
  69. table.sort(servers.Collection, function(a, b) return computeGUIDhash(a.Guid)>computeGUIDhash(b.Guid) end)
  70. local serv={}
  71. for n, server in pairs(servers.Collection) do
  72. local namet={}
  73. for _, t in ipairs(server.CurrentPlayers) do
  74. table.insert(namet, t.Username)
  75. end
  76. serv[n]={players=namet, id=server.Guid}
  77. end
  78. return serv
  79. end
  80. join=function(id, player)
  81. local servers=getServers(false)
  82. game:GetService"TeleportService":TeleportToPlaceInstance(game.PlaceId,servers.Collection[id+0].Guid, player)
  83. end
  84.  
  85.  
  86.  
  87. portals={}
  88.  
  89.  
  90. function wall(parent, p1, p2, color)
  91. local part=Instance.new("Part", parent)
  92. local lowerpoint=Vector3.new(math.min(p1.X, p2.X), math.min(p1.Y, p2.Y), math.min(p1.Z, p2.Z))
  93. local higherpoint=Vector3.new(math.max(p1.X, p2.X), math.max(p1.Y, p2.Y), math.max(p1.Z, p2.Z))
  94. local size=higherpoint-lowerpoint
  95. part.Size=size
  96. part.Anchored=true
  97. part.CanCollide=false
  98. part.TopSurface="Smooth"
  99. part.BottomSurface="Smooth"
  100. part.CFrame=CFrame.new(lowerpoint:lerp(higherpoint, .5))
  101. coroutine.yield()
  102. part.CanCollide=true
  103. if color then
  104. part.BrickColor=BrickColor.new(color)
  105. end
  106. return part
  107. end
  108.  
  109.  
  110.  
  111. wtime=20
  112. radius=70;
  113. ptick=tick()
  114. shared.ptick=ptick
  115. while shared.ptick==ptick do
  116. local yval=shared.coolroom and -shared.cooldepth +5.5 or 5
  117.  
  118. local serv=listservers()
  119. local pserv={}
  120. table.foreach(portals, function(_,p)p:Destroy() end)
  121. portals={}
  122. local n=0
  123. for n, server in pairs(serv) do
  124. n=n+1
  125. local portal=createPortal()
  126. table.insert(portals, portal)
  127. table.insert(pserv,server)
  128. --add touch-tele code here
  129. end
  130. np=#portals
  131. for i=1, np do
  132. local sg=Instance.new("SurfaceGui", portals[i].Portal)
  133. sg.CanvasSize=Vector2.new(200, 200)
  134. local text=Instance.new("TextLabel", sg)
  135. text.FontSize=Enum.FontSize.Size96
  136. text.Size=UDim2.new(1,0,1,0)
  137. text.Text=i..""
  138. text.BackgroundTransparency=1
  139. text.BorderSizePixel=0
  140. text.TextStrokeTransparency=0
  141. text.Font=Enum.Font.SourceSansItalic
  142. text.TextStrokeColor3=Color3.new(1, 1, 1)
  143. text.TextColor3=Color3.new(0, 0, 0)
  144. sg.Adornee=sg.Parent
  145. sg.Face=Enum.NormalId.Top
  146. local ppart=portals[i].Portal
  147.  
  148. portals[i].Portal.Touched:connect(function(part)
  149. local plyr=game.Players:GetPlayerFromCharacter(part.Parent) or game.Players:GetPlayerFromCharacter(part.Parent.Parent)
  150. if plyr~=nil then
  151. game:GetService"TeleportService":TeleportToPlaceInstance(game.PlaceId, pserv[i].id, plyr)
  152. end
  153. end)
  154. ppart.CFrame=(CFrame.new(CFrame.Angles(0, (i/np)*2*math.pi, 0)*Vector3.new(0, yval, radius), Vector3.new(0, yval, 0)))*CFrame.Angles(-math.pi/2, 0, 0)*CFrame.Angles(0, math.pi*.5, 0)
  155. local w1=wall(portals[i], (ppart.CFrame*CFrame.new(6, 0, 6)).p, (ppart.CFrame*CFrame.new(-6, -1.1, 6)).p, "Dark stone grey")
  156. w1.CFrame=CFrame.new(w1.CFrame.p, Vector3.new(0, yval, 0))
  157. local w2=wall(portals[i],(ppart.CFrame*CFrame.new(6, 0, -6)).p, (ppart.CFrame*CFrame.new(-6, -1.1, -6)).p, "Dark stone grey")
  158. w2.CFrame=CFrame.new(w2.CFrame.p, Vector3.new(0, yval, 0))
  159. local top=wall(portals[i], Vector3.new(0, 0, -6), Vector3.new(1, 1, 6), "Dark stone grey")
  160. top.CFrame=ppart.CFrame*CFrame.Angles(0, math.pi/2, 0)*CFrame.new(0, -.55, -5.5)*CFrame.Angles(0, -math.pi/2, 0)
  161. local sg2=Instance.new("SurfaceGui", top)
  162. sg2.Adornee=top
  163. sg2.Face=Enum.NormalId.Top
  164. sg2.CanvasSize=Vector2.new(1000, 100)
  165. local text2=Instance.new("TextLabel", sg2)
  166. text2.TextScaled=true
  167. text2.Size=UDim2.new(1,0,1,0)
  168. text2.Text=i..""
  169. text2.BackgroundTransparency=1
  170. text2.BorderSizePixel=0
  171. text2.TextStrokeTransparency=1
  172. text2.TextColor3=Color3.new(.8, .8, .8)
  173. text2.Text=table.concat(pserv[i].players, ", ")
  174. text2.Font=Enum.Font.SourceSans
  175. local rot=0
  176. coroutine.wrap(function()
  177.  
  178. while ppart do
  179. rot=(rot+3)%360
  180. ppart.CFrame=(CFrame.new(CFrame.Angles(0, (i/np)*2*math.pi, 0)*Vector3.new(0, yval, radius), Vector3.new(0, yval, 0)))*CFrame.Angles(-math.pi/2, 0, 0)*CFrame.Angles(0, math.pi*.5+math.rad(rot), 0)
  181. text.Rotation=rot-1
  182. wait()
  183. end
  184. end)()
  185. end
  186. coroutine.wrap(function()
  187. for t=1, 0, -.1 do
  188. for i=1, np do
  189. for _, p in ipairs(portals[i]:GetChildren()) do
  190. if p:IsA"BasePart" then
  191. p.Transparency=t
  192. end
  193. end
  194. end
  195. wait(.1)
  196. end
  197. end)()
  198. wait(wtime)
  199. end
  200. table.foreach(portals, function(_,p)p:Destroy() end)
Add Comment
Please, Sign In to add comment