what I mean is when a player enters it checks to see who it is
local function enter (player)
-- What would go in between? a connect: block or a while true do block. Also how would it know to remove them if they were the certain player?
end
what I mean is when a player enters it checks to see who it is
local function enter (player)
-- What would go in between? a connect: block or a while true do block. Also how would it know to remove them if they were the certain player?
end
function onEnter(p)
print (p.Name) -- Prints player's name
end
game.Players.PlayerAdded:connect(onEnter)
OR
game.Players.PlayerAdded:connect(function(p)
print (p.Name) -- Prints player's name
end)
RESPONSE TO YOUR COMMENT:
local banland = "noob jimmy nobodylikesme"
game.Players.PlayerAdded:connect(function(p)
for w in string.gmatch(banland, "%a+") do
if string.lower(p.Name) == string.lower(w) then
p:Kick()
break
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
I need it so it kicks the person if their on the script. example: function onEnter (p) --print (p.NName) end Game.PlayerAdded:connect(onEnter) if p = NAME then game.Players.NAME:destroy() end