i want to make a script that does print when a player joins and has the same name/userid as the one in the module script but i dont know how to do that, here's the script:
local Whitelist = require(script.Parent.Whitelist) local player = game:GetService("Players") player.PlayerAdded:Connect(function(plr) if plr.Name == Whitelist.whitelist.Users then print('Whitelisted') else print('Not Whitelisted') end end)
and here's the module script:
local whitelist = {} whitelist.Users = {"mahid786", "GameTime_Studio", "diegodamaw", "amirgun2", "Bloxy_Cone"} return whitelist
can someone please help me?
Ok so, a ModuleScript is not required, you can put the usernames in a normal script inside ServerScriptService(SSS). Or alternatively use this script:
local admins = {"player1","player2"} game.Players.PlayerAdded:Connect(function(player) for i = 1, #admins do if admins[i] == player.Name then --whatever you want