generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Whats wrong with this?

Previous Thread :: Next Thread 
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 09:08 PM
Should be refreshing showing servers on a gui but its not? anyone know the issue?

script:
local FrameDetails = script:WaitForChild("FrameDetails")
local debounce = require(game.ReplicatedStorage.Abstract.Debounce)

game.ReplicatedStorage.RemoteEvents.GetServerList.OnClientEvent:connect(function(serverList)
print("Server: "..tostring(serverList))
script.Parent.Parent.SFServerList:ClearAllChildren()
local canvasSizeHeight = 0
for _, obj in pairs(serverList) do
--[[print("serverList["..tostring(_).."] = "..tostring(obj))
for _2, obj2 in pairs(obj) do
print("serverList["..tostring(_).."] ["..tostring(_2).."] = "..tostring(obj2))
end
for _3, obj3 in pairs(obj[3]) do
print("serverList["..tostring(_).."] [3] ["..tostring(_3).."] = "..tostring(obj3))
end]]
local data = {}
data.session = obj[1]
data.players = obj[2]
data.data = obj[3]

local dataframe = script.FrameDetails:Clone()

dataframe.TLTitle.Text = "Clue Session" --data.data.GameName
dataframe.TLInfo.Text = data.players.." Players"

--if (game.JobId~="") then
dataframe.TBJoin.MouseButton1Click:connect(function()
print("Joining "..tostring(data.session))

game.ReplicatedStorage:WaitForChild("RETPPlayer"):FireServer(game.ReplicatedStorage.Settings.GamePlaceId.Value, data.session, true)
end)
--end

dataframe.Position = UDim2.new(0, 0, 0, (((_)-1)*40)+8)

dataframe.Parent = script.Parent.Parent.SFServerList

canvasSizeHeight = canvasSizeHeight+40
end

script.Parent.Parent.SFServerList.CanvasSize = UDim2.new(0,0,0,canvasSizeHeight)
end)

script.Parent.MouseButton1Click:connect(debounce(function()
local event = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("GetServerList")
event:FireServer()
end))
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
18 Sep 2016 09:11 PM
learn to debug yourself

do some print debugging


Report Abuse
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 09:14 PM
also this is another script in serverscriptservice that also does it, and prints 0 servers when there is servers when you click refresh...

local serverListReturn = {}
local event = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("GetServerList")

event.OnServerEvent:connect(function(player)
print("Servers: "..(#serverListReturn))
event:FireClient(player, serverListReturn)
end)
wait(0.5)

local lobby = require(266813685)

function update()
local serverdetails = lobby.getServerList(game.ReplicatedStorage.Settings.GamePlaceId.Value, 1)
--[[for _, obj in pairs(serverdetails) do
print("serverdetails["..tostring(_).."] = "..tostring(obj))
end]]

if(serverdetails["servers"]) then
serverListReturn = serverdetails.servers
else
serverListReturn = {}
end
end


update()

while wait(10) do
update()
end


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
18 Sep 2016 09:48 PM
print to see how far the script is getting. what is being returned?


Report Abuse
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 09:50 PM
goes all the way

but the issue is it says 0 severs when there is 1 server ( i tried with only 1 because i dont got that many ppl to test with lol )


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
18 Sep 2016 09:52 PM
your problem is in the following code.

check to see why there is nothing being returned in the table

local lobby = require(266813685)

function update()
local serverdetails = lobby.getServerList(game.ReplicatedStorage.Settings.GamePlaceId.Value, 1)
--[[for _, obj in pairs(serverdetails) do
print("serverdetails["..tostring(_).."] = "..tostring(obj))
end]]

if(serverdetails["servers"]) then
serverListReturn = serverdetails.servers
else
serverListReturn = {}
end
end


Report Abuse
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 09:53 PM
ya idk wat 2 do


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
18 Sep 2016 09:54 PM
what does this print?

local serverdetails = lobby.getServerList(game.ReplicatedStorage.Settings.GamePlaceId.Value, 1)

for i,v in next, serverdetails do
print(i,v)
end


Report Abuse
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 10:26 PM
Server: table: 0D911258


Report Abuse
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 10:28 PM
when you click refresh it says that but with a random table every time.


Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
18 Sep 2016 10:30 PM
It's not a random table, that's the address of the table in memory(I think)
Report Abuse
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 10:31 PM
o mb


Report Abuse
C1OSE is online. C1OSE
Joined: 29 May 2011
Total Posts: 604
18 Sep 2016 10:40 PM
so no1 knows? :(


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image