You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,3 +43,14 @@ Managing roles/permission levels is done via the `/setadmin`, `/setscribe`, `/se
43
43
44
44
* If the experience is owned by a Roblox group, you cannot manually set the `robloxGroupId` as it is set automatically to the owning group.
45
45
* You can use `/setrobloxgroup N` to set your Roblox group (as usual, find the ID by navigating to your group on the Roblox homepage and extracting it from the URL).
46
+
47
+
## Generating a Release
48
+
49
+
The `metaadmin.rbxmx` file is generated like this
50
+
```bash
51
+
rojo build --output "build.rbxlx"
52
+
remodel run admin_packager.lua
53
+
```
54
+
55
+
The first command builds a place file according to `default.project.json`.
56
+
The second command uses [remodel](https://github.com/rojo-rbx/remodel) to extract the `ChatModules` folder as an `rbxmx` file.
Text="Cannot manually set Roblox group for an experience owned by a group.";
469
-
ChatColor=Color3.new(1,0,0)
470
-
}, speaker.Name)
471
-
returnfalse
472
-
end
473
-
474
509
localgroupId=tonumber(args[1])
475
510
476
511
ifgroupId==nilthen
@@ -484,6 +519,12 @@ function BindCommands()
484
519
-- groupId checks out, set the Roblox group and update settings
485
520
robloxGroupId=groupId
486
521
LoadSettingsFromGroup(groupId)
522
+
LoadPermissionsFromGroup(groupId)
523
+
524
+
SendMessageToClient({
525
+
Text="Roblox group set to "..groupId..".";
526
+
ChatColor=Color3.new(0, 1, 0)
527
+
}, speaker.Name)
487
528
end
488
529
})
489
530
@@ -582,7 +623,7 @@ function BindCommands()
582
623
583
624
BindCommand({
584
625
name="boards",
585
-
perm=Settings.ScribePerm,
626
+
perm=Settings.AdminPerm,
586
627
usage=Settings.Prefix.."boards {on|off}",
587
628
brief="Turn the whiteboards on/off for guests (anyone below scribe level)",
588
629
help="'"..Settings.Prefix.."boards off' deactivates drawing on whiteboards for guests, and anyone with permission level below 'scribe'.\n'"..Settings.Prefix.."boards on' allows anyone to draw on whiteboards",
@@ -632,13 +673,6 @@ function BindCommands()
632
673
localuserId=GetUserId(name)
633
674
634
675
ifuserIdthen
635
-
ifSettings.Admins[userId] then
636
-
SendMessageToClient({
637
-
Text="This player's permission level is hardcoded to the value "..tostring(Settings.Admins[userId])..". This change will be overwritten when the server restarts.";
638
-
ChatColor=Color3.new(1, 0, 0)
639
-
}, speaker.Name)
640
-
end
641
-
642
676
SetPermLevel(userId, level)
643
677
UpdatePerms(userId)
644
678
@@ -710,13 +744,6 @@ function BindCommands()
710
744
end
711
745
712
746
ifuserIdthen
713
-
ifSettings.Admins[userId] then
714
-
SendMessageToClient({
715
-
Text="This player's permission level is hardcoded to the value "..Settings.Admins[userId]..". This change will be overwritten when the server restarts.";
716
-
ChatColor=Color3.new(1, 0, 0)
717
-
}, speaker.Name)
718
-
end
719
-
720
747
SetPermLevel(userId, level)
721
748
UpdatePerms(userId)
722
749
@@ -836,58 +863,50 @@ local function CreateRemotes()
836
863
end
837
864
end
838
865
839
-
localfunctionLoadSettingsFromGroup(groupId)
840
-
ifgroupId==0then
841
-
Settings.ScribePerm=50
842
-
Settings.AdminPerm=254
843
-
return
844
-
end
845
-
846
-
localsuccess, response=pcall(function()
847
-
returnGroupService:GetGroupInfoAsync(groupId)
848
-
end)
849
-
ifsuccessthen
850
-
ifresponseandresponse.Rolesthen
851
-
for_, roleinipairs(response.Roles) do
852
-
ifrole.Name=="Scribe" then
853
-
-- Overwrite settings for scribes
854
-
Settings.ScribePerm=role.Rank
855
-
end
856
-
857
-
ifrole.Name=="Admin" then
858
-
-- Overwrite settings for admins
859
-
Settings.AdminPerm=role.Rank
860
-
end
861
-
end
862
-
end
863
-
else
864
-
print("[Admin] Failed to get group info")
865
-
end
866
-
end
867
-
868
866
-- Binds all commands at once
869
867
functionRun(ChatService)
870
-
-- If the game is created by a group, set this as the robloxGroupId
871
-
ifgame.CreatorType==Enum.CreatorType.Groupthen
872
-
robloxGroupId=game.CreatorId
868
+
-- The CREATOR of an experience is one who published it to Roblox. This can be an individual
869
+
-- user or a group. The OWNER of an experience is the creator in the case of public servers,
870
+
-- but for private servers it is the person who made the private server.
871
+
--
872
+
-- In the case of private servers we do not give the creator (or those in the group, if the
873
+
-- creator is a group) special permissions in the server, as the owner of the private server
874
+
-- does not expect this and may not be able to know what permissions have been set in that group.
875
+
876
+
-- For a private server, the robloxGroupId is 0 by default (ununsed) and may be
877
+
-- set by the owner to whatever they like
878
+
879
+
-- For a public server, the robloxGroupId is 0 by default (unused), is automatically
880
+
-- set to the group if the server is created by a group, and may be set by admins
881
+
-- to whatever they like
882
+
883
+
-- Note that by the time this runs, permissions, scribeOnlyMode and robloxGroupId
884
+
-- have been read from the DataStore, so anything we do not now is overwriting
885
+
-- those stored settings (and will be written on server shutdown to the DataStore)
886
+
887
+
-- Give admin rights to owners of private servers and the creator of
888
+
-- public servers if they are a user
889
+
ifisPrivateServer() then
890
+
print("[Admin] Giving private server owner "..tostring(game.PrivateServerOwnerId).." admin")
891
+
SetPermLevel(game.PrivateServerOwnerId, 255)
892
+
elseifgame.CreatorType==Enum.CreatorType.Userthen
893
+
print("[Admin] Giving game creator "..tostring(game.CreatorId).." admin")
894
+
SetPermLevel(game.CreatorId, 255)
895
+
end
896
+
897
+
ifnotisPrivateServer() androbloxGroupId==0then
898
+
-- If the game is created by a group, set this as the robloxGroupId
899
+
ifgame.CreatorType==Enum.CreatorType.Groupthen
900
+
robloxGroupId=game.CreatorId
901
+
end
873
902
end
874
903
875
904
-- Look for Roblox group settings on Scribe and Admin rank cutoffs
876
905
ifrobloxGroupId~=0then
906
+
print("[Admin] Loading settings from group "..tostring(robloxGroupId))
0 commit comments