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
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
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
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.