Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
Sample scripts to test the module
  • Loading branch information
ddavness committed Aug 16, 2019
1 parent 5fc2fb5 commit 144e533
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Tests/CheckBanned.server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local Trello = require(script.Parent.Trello.Main)
local MainBoard = Trello:GetBoardByName("Banned Noobs")
local Banned = MainBoard:GetListByName("Banned")

function checkBanned(Player)
local isBanned = Banned:GetCardByName(tostring(Player.UserId))
print(isBanned)
if isBanned then
Player:Kick("You have been banned from this game.\n\nModerator Note: "..isBanned:GetDesc())
end
end

-- Check for players yet to come
game:GetService('Players').PlayerAdded:Connect(checkBanned)

-- Check for players that already arrived
for _,p in pairs(game:GetService('Players'):GetPlayers()) do
checkBanned(p)
end

print("All set!")
1 change: 1 addition & 0 deletions default.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"$className": "DataModel",

"ServerScriptService": {
"$path": "Tests",
"$className": "ServerScriptService",
"$ignoreUnknownInstances": true,
"Trello": {
Expand Down

0 comments on commit 144e533

Please sign in to comment.