I’m trying to make a ban script (I don’t want a ban command or anything like that) where I can gather the player’s userId and the reason, but I don’t know how to do it.
local ban = {
[1] = "reason"
}
game.Players.PlayerAdded:Connect(function(plr)
if table.find(ban, plr.UserId) then
plr:Kick("Club Trendi You have been banned. Reason: array here")
end
end)
local BannedPlayers = {
[1] = "reason"
}
game.Players.PlayerAdded:Connect(function(Player)
for UserId, Reason in pairs(BannedPlayers) do
if Player.UserId == UserId then
Player:Kick("Club Trendi You have been banned. Reason: ".. Reason)
end
end
end)
-- guessing that the format will be ':ban [player id] [reason]'
local PS = game:GetService("Players")
PS.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
local split = string.split(message, " ")
local command, id, reason = split[1], split[2], split[3]
end)
end)
local PS = game:GetService("Players")
local ban = {
[13131313] = "reason"
}
PS.PlayerAdded:Connect(function(plr)
if ban[plr.UserId] then
plr:Kick("Club Trendi You have been banned. Reason: " .. ban[plr.UserId])
end
end)
local ban = {
[(userId here)] = {
["reason"] = "reason here"
}
}
game.Players.PlayerAdded:Connect(function(plr)
if ban[plr.UserId] then
plr:Kick("Club Trendi You have been banned. Reason:"..ban[plr.UserId]["reason"])
end
end)
local ban = {
[(userId here)] = {
["reason"] = "reason here",
["admin"] = "achdef"
}
}
game.Players.PlayerAdded:Connect(function(plr)
if ban[plr.UserId] then
plr:Kick("Club Trendi You have been banned by"..ban[plr.UserId]["admin"]..". Reason:"..ban[plr.UserId]["reason"])
end
end)