local Moderators = {"Sk3pticalR0BL0X"} --Enter the names of players who can use the GUI. ---------------------------------- -- DO NOT EDIT BEYOND THIS LINE -- ---------------------------------- game.Players.PlayerAdded:connect(function(GetMods) game.Lighting.KickGUI:Clone().Parent = game.Players[Moderators].PlayerGui end)
For first, :connect
is deprecated. Use :Connect
You need to use a "For loop", for get moderator use generic for loop. example:
-- Generic for loop -- Basically generic for loop have "index,value" the value is the string stored in a table, and index is "string position", example: local Table = {"String1","String2","String3"} -- also you can use: i,v for index,value in pairs(Table) do print("The index is: " .. tostring(index) .. " The value is: " .. tostring(value)) end
local moderators = {"Player1","Player2","Player3"} game.Players.PlayerAdded:Connect(function(Player) -- if you use _,... or ...,_ the _ is a nil value, after you put _ you can't use this. for _,moderator in pairs(moderators) do -- Generic for loop, getting all strings in table -- if you use print(_) this return nil. if Player.Name == moderator then -- Check if Player Name is equal to moderator name print("The player: " .. Player.Name .. " is a moderator!") end end end)
For your script you can use this:
local Moderators = {"Sk3pticalR0BL0X"} --Enter the names of players who can use the GUI. ---------------------------------- -- DO NOT EDIT BEYOND THIS LINE -- ---------------------------------- game.Players.PlayerAdded:Connect(function(Player) for _,moderator in pairs(Moderators) do if Player.Name == moderator then game.Lighting.KickGUI:Clone().Parent = Player:WaitForChild("PlayerGui") -- Lighting is not a good way to storage items, use ServerStorage for this. end end end)
Hope it helped