Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i use PlayerAdded to kick a player with a not name?

im trying to make a script where if a player joins then if their name isn't a certain name to kick them. how shuld i go about this?

local name = "luaa233"
if game.Players:PlayerAdded().Name ~= name then
game.Players:PlayerAdded():Kick()
end

1 answer

✓ Accepted answer
local name = "luaa233"
game.Players.PlayerAdded:Conenct(function(plr)
if plr.Name ~= name then
plr:Kick("Reason Here")
end
end)

The reason your script was not working is because PlayerAdded is a function, and you were not using it correctly. "plr" is the first argument (optional), the player that is added.

1 comment

0

I'm not going to keep answering questions that are in the dev forums, which i have informed you about three times. You're not even trying at this point.

This discussion is preserved as it was. New answers, comments, and votes are closed.