In this tutorial, you'll learn how to set up a server whitelist on your Garry's Mod server using a custom Lua script and the VolticHost Game Panel. This method allows you to restrict access to only approved players by their SteamIDs, ensuring a more secure and controlled gaming environment. 🚀
📌 Prerequisites
-
A Garry's Mod server purchased at VolticHost.com
-
Access to the VolticHost Game Panel
-
Basic knowledge of Lua scripting and file management
-
A list of SteamIDs for the players you wish to whitelist
1️⃣ First Step - Creating the Whitelist Script
-
Log in to VolticHost Game Panel.
-
Navigate to the File Manager from the main dashboard.
-
Go to the
/garrysmod/lua/autorun/server/
directory. -
Create a new file named
whitelist.lua
in this directory. -
Open
whitelist.lua
for editing and paste the following script:if SERVER then local whitelist = { ["STEAM_0:1:12345678"] = true, ["STEAM_0:1:87654321"] = true } hook.Add("PlayerInitialSpawn", "WhitelistCheck", function(ply) if not whitelist[ply:SteamID()] then ply:Kick("You are not whitelisted on this server.") end end) end
-
Replace the example SteamIDs with the actual SteamIDs of the players you want to allow.
-
Save the file after editing.
✅ Whitelist script created and saved successfully!
2️⃣ Next Step - Activating the Whitelist
-
Restart your server from the VolticHost Game Panel to load the new Lua script.
-
Once the server is running, only the players with the specified SteamIDs will be able to join.
-
Test the setup by attempting to join the server with a SteamID not on the whitelist to ensure they are kicked.
✅ Whitelist activated and tested successfully!
🎉 Conclusion
You have now successfully set up a server whitelist on your Garry's Mod server using a custom Lua script via the VolticHost Game Panel! Enjoy a more secure and controlled gaming environment by ensuring only approved players can join. 🚀
For more assistance, contact VolticHost Support.