I decided to create a whitelist system with several parameters
What can he do?
1.Kick players if their id does not match a list
2.Kick the player if he doesn’t have one of the friends Ids in the list
3. Customizable Kick Message
4.Instead of kicking a player, teleports it to another place (if teleportation fails he kicks the player)
5.When teleporting a GUI and localscript prevent the user from seeing the map / chat
6.You can check if a user has a certain rank in a group
What do the Settings look like?
This look like this
local Settings = {}
Settings.allowedUser = {--[[Put userId of player can join the game]]
604793674, -- Med367367
-1, -- Player1
}
Settings.allowedFriendWith = {---[[Put userId, if the user joins the game is friends with one of the userId]]
604793674, -- Med367367
-1, -- Player1
}
Settings.allowedGroups = {--[[Put groupId and rankID, if the user joins the game and is not in the group or don't have the rank he will get kicked / teleported to place]]
{5707589,255}, -- Group Med Studio Rank Owner
}
Settings.GameIdRedirect = false --change false for a gameId and the person will teleport in the game corresponding to the ID instead of doing beging kicked.
Settings.kickMsg = "You are not authorized to join this game, please contact the owner"
return Settings
How would this help developers in a substantial way? Ultimately, this is really simple to make, and wouldn’t take a long time making it. All you have to do is the following:
Have a table of blacklisted/whitelisted players/groups/etc
When a player joins, check their UserId
If they match, they either get kicked out or get to join
The point of custom modules is to make life easier, not to script short code for them.
Maybe, but for those just starting out it can be useful if he wants to have fun modifying it
Otherwise, I use the modules because I prefer to do this
And, it’s not easy for everyone to use a table, even if these simple
I agree with @VegetationBush. This isn’t really a good community resource in my opinion because it is really simple to make. Most of the devs on the forum here would prefer intermediate/advanced tutorials or systems, which this does not fall under.
Yah I mean its simple to make but there are people who will find use for it. Not all devs in devforum are intermediate or advanced. Atleast, it will help someone
@VegetationBush@PepperGV3 personally I don’t see the need for either one of your comments.
This is a resource thread where the OP has created something for other developers to use, if you don’t find it useful. Don’t use it, others may find it helpful.
Back on topic, this whitelist system seems like it will help some people who don’t really know LUA but need a whitelist system but can’t really trust toolbox, for obvious reasons.
Thank you for contributing to DevForums @Med367367.
True, this might not help many advanced scripters, but it will help beginners or non-scripters who only want to allow friends or groups to join their game. It’s useful for things like showcases, where the creator doesn’t know how to script and needs to whitelist specific players.
Hey dude, thanks for sharing your creation. Overall scripting style looks good, and this should be useful to a select number of group leaders limiting their game’s access. And it’s nice that you’re resource puts a whitelist system into context and backs up a teleporting UI. Found one error on a slight glance, so check that out.
White list groups only consider one group entry. You’re returning false if after checking the player’s status in the first group in the settings table. So remove the else statement on line 32.
Oh lol, also get the user’s actual rank in the group. It looks like your checking if the allowed rank is equal to the group’s id
But overall, this script does seem to accomplish a trivial and very specific task. I would look into modifying this resource to provide greater automation for a more diverse usage.
What if instead, you made a module which returned a series of functions automating whitelists in all sorts of scripts. Like design it so that scripts can create whitelist tables, add/remove elements in those tables. Other scripts could also call whitelist queries with both a user’s name or userid and get returned a bool value. Design it so that queries can be made with two whitelist tables using AND, OR operations to test if a player meets both. I think a SQL inspired whitelist/ blacklist database would be more used and seen.
No one is saying that it isn’t a resource, but the point they are making is that the resource might not be significant enough for this category. Per About the Community Resources category resources in the category “must be more substantial than small scripts or a few individual assets. Resources that are not significant enough, too specific / not useful to many people, or too low quality should be posted in a different forum category”.
Everything can be argued to be helpful to someone (since everyone starts with 0 knowledge at some point), but this section has a threshold so that resources of free collections of extremely simple assets, very basic scripts (ex: basic ban script), etc. are not posted which would clutter up the more significant resources posted.