if game.Players.PlayerAdded:Connect(fucntion() if game.Players.LocalPlayer.Name == ("hokyboy,Kampatala") then script.Parent.Parent.Parent:Destroy() end
so this is what i tried i first tried it with a loop(yes i was bening stupid) now i dont know how to fix this and is there a way to kick a player using this metod and then let the kick say Error:You dont have acces to this game?
yes; and here is how you can do it
local allowed = { "Arsubia12", "bleh" } game.Players.PlayerAdded:Connect(function(player) for _, plr in pairs(allowed) do if player.Name:lower() == plr:lower() then return 0 ; end end player:Kick("You dont have acces to this game?") end)
in the variable allowed
, put in the names of the people that are allowed to join separated with commas