Trello Ban Script not banning new players?
Asked by
8 years ago Edited 8 years ago
Hello!
To begin with, the script works at first. When I join a server and do ban plrName the player get's put on the Trello, His name and his userID are printed in the console.
But let's say another player joins, I'm not able to ban him untill I rejoin myself.
I do not believe the trello api I'm using is needed, But if it is just ask.
02 | api = require(game.ServerScriptService.TrelloAPI) |
03 | BoardID = api:GetBoardID( "NewTest" ) |
04 | ListID = api:GetListID( "Ban List" ,BoardID) |
06 | speakers = { "Robertandy11" } |
09 | function checkSpeakers(name) |
10 | for i,v in pairs (speakers) do |
11 | if (string.upper(name) = = string.upper(v)) then return true end |
16 | function onChatted(msg, recipient, speaker) |
18 | if string.sub(msg, 1 , 4 ) = = "ban " then |
19 | if game.Players:FindFirstChild(string.sub(msg, 5 )) ~ = nil then |
20 | local victim = string.sub(msg, 5 ) |
22 | local victimid = game.Players:GetUserIdFromNameAsync(victim) |
25 | api:AddCard((victim.. ":" ..victimid) , "Banned" , ListID) |
26 | local removedpl = game.Players:FindFirstChild(victim) |
32 | function onPlayerEntered(newPlayer) |
35 | for i,v in pairs (banned) do |
36 | if (v:lower() = = newPlayer.Name:lower()) then |
40 | if checkSpeakers(newPlayer.Name) then |
41 | newPlayer.Chatted:connect( function (msg, recipient) onChatted(msg, recipient, newPlayer) end ) |
44 | game.Players.PlayerAdded:connect(onPlayerEntered) |
45 | print ( "Ban Commands Loaded!" ) |
Edit : All this script is supposed to do is create a Card on the banlist on trello, which it does But not for the players that join after the Admin/Moderator.
The script that takes care of game-wide banning people and syncing bans is alerady done.