1 | if game.Players.PlayerAdded:Connect(fucntion() |
2 | if game.Players.LocalPlayer.Name = = ( "hokyboy,Kampatala" ) then |
3 | script.Parent.Parent.Parent:Destroy() |
4 |
5 | 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
01 | local allowed = { |
02 | "Arsubia12" , |
03 | "bleh" |
04 | } |
05 |
06 |
07 | game.Players.PlayerAdded:Connect( function (player) |
08 | for _, plr in pairs (allowed) do |
09 | if player.Name:lower() = = plr:lower() then |
10 | return 0 ; |
11 | end |
12 | end |
13 |
14 | player:Kick( "You dont have acces to this game?" ) |
15 | end ) |
in the variable allowed
, put in the names of the people that are allowed to join separated with commas