question

Jorge Agustin Ciaccio Costa avatar image
Jorge Agustin Ciaccio Costa asked

Can't create shared group from cloudscript

handlers.helloWorld = function(args, context){
    try{
        server.CreateSharedGroup({SharedGroupId: "test"});
    }
    catch(err){
        var message = "Could not create group"
        return {messageValue: message};
    }
    var message = "Hello " + currentPlayerId + "!";
    return {messageValue: message};
}

Im trying to learn how to code and use cloudscript, but cant figure out why this doesnt work. Any help is greatly appreciated

CloudScriptShared Group Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Turner avatar image
Turner answered

Hey Jorge,

After copy/pasting your code I called GetSharedGroupData passing in the same "test" SharedGroupId and it did return successfully so your CloudScript code is working for me.

How are you verifying that it is not creating a shared group? Is it printing out "Could not create group"?

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jorge Agustin Ciaccio Costa avatar image Jorge Agustin Ciaccio Costa commented ·

Hello, i thought it would show up on the game manager Players > Shared Group Data.

0 Likes 0 ·
Turner avatar image Turner Jorge Agustin Ciaccio Costa commented ·

Nothing will show up for a shared group if it doesn't have any data. One of the ways you can verify this is by calling AddSharedGroupMembers. Then if you were to go back to Players -> Shared Group Data and type in sharedGroupId, you'll see the player that was added under "Members"

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.