Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

:CreatePlaceAsync creating out dated places?

Asked by 11 years ago

I have a problem with :CreatePlaceAsync where it gets an older version of the base place than the current one. I have tested it and only after I join the lobby, create a new "server" or new place, leave, and join the lobby again will it allow me to create updated places. I'm not sure what could be wrong with this, but if anyone has some experience with it, mind sharing it?

Code where I make the server:

01function Workspace.createServer.OnServerInvoke(plr, server_name, server_password, public, official)
02    if not _G.serverList[1] == "default" then
03        serverData:SetAsync("server"..tostring(#_G.serverList+1), {plr.userId, plr.Name, #_G.serverList, server_name, server_password, public, official})
04    else
05        serverData:SetAsync("server"..tostring(#_G.serverList), {plr.userId, plr.Name, #_G.serverList, server_name, server_password, public, official})
06    end
07    if pcall(function() newServ = game:GetService("AssetService"):CreatePlaceAsync("server"..#_G.serverList, 22974285); end) then -- Specifically where I actually create it.
08        newMsg("Server Attempted to create a place");
09    else
10        newServ = #_G.serverList;
11        newMsg("Error creating new server");
12    end
13    serverData:UpdateAsync("servers", addServer)
14end
1
Make sure newServ is localized before your pcall. Quenty 226 — 11y

Answer this question