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 10 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:

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

Answer this question