Since i’m not the greatest at scripting, I followed a YouTube tutorial in making a blacklisting script, to keep some certain people out of my game. When I put the script in ServerScriptService (like the tutorial told me to) and tested the game, the game restricts ME from playing, even though my Roblox ID is nowhere to be found in the script.
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if Player.UserId == 66122912 or 1264361333 or 188910633 or 1681950129 then
Player:Kick("You are no longer welcome in this game...")
end
end)
end)
That’s the code in its entirety.
I’d thought i’d mention that my Roblox ID is 188659181.
game.Players.PlayerAdded:Conect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if Player.UserId == 66122912 or Player.UserId == 1264361333 or Player.UserId == 188910633 or Player.UserID == 1681950129 then
Player:Kick("You are no longer welcome in this game...") --Sounds menacing but it is needed
end
end)
end)
The reason we mention the Player.UserId so much is because we need to ‘remind’ the script in where it is checking it’s information. To demonstrate we can say:
if XDValue.Value == 451 or XDntValue.Value == -451 then
--Function
end
Up there we were able to make the script check the XD value or the XDnt value to make sure it run the function if either is true.