is it possible to create a role in cloudscript?
is it possible to create a role in cloudscript?
here's an example of what I've done, I create the group and I want to use the group id to create a role but it returns a null.
handlers.CreateGroup = function(args){ var groupName = args.groupName;
try{
//creer le groupe var groupData = entity.CreateGroup({ Entity: args.player, GroupName: groupName }); var groupId = groupData.Group.Id; // Utilisez les API PlayFab pour créer le rôle dans le groupe
// Appelez l'API PlayFab pour créer le rôle dans le groupe
var role = entity.CreateRole() ({ RoleName: "roleName", RoleId : "roleNam", Group: { Id : groupId, Type : "group" } });
If you are referring to the role of the group, you could call the CreateRole API (https://learn.microsoft.com/en-us/rest/api/playfab/groups/groups/create-role?view=playfab-rest) like this: entity.CreateRole() in Cloud Script to create the role for the group.
here's an example of what I've done, I create the group and I want to use the group id to create a role but it returns a null
///create groupe
handlers.CreateGroup = function(args){
var groupName = args.groupName;
try{
//creer le groupe
var groupData = entity.CreateGroup({
Entity: args.player,
GroupName: groupName
});
var groupId = groupData.Group.Id;
// Utilisez les API PlayFab pour créer le rôle dans le groupe
// Appelez l'API PlayFab pour créer le rôle dans le groupe
var role = entity.CreateRole() ({
RoleName: "roleName",
RoleId : "roleNam",
Group: {
Id : groupId,
Type : "group"
}
});
return role;
2 People are following this question.