This is supposed to check Trello if your name exists on the weapon ban list, and if it does, do nothing. If it doesn't, you're supposed to be given the weapon. I really don't understand why I can't figure this out but I'm getting quite confused-three cards, two with playername:playerid. Help? I'm braindead:
local wep = game.ServerStorage.Revolver
local mps = game:GetService("MarketplaceService")
local api = require(game.ServerScriptService.TrelloAPI)
local notallowed
local n
local i
local pass1 = 225096688
local pass2 = 245915579
--local allowed = {
-- [BrickColor.new("White")] = true;
-- [BrickColor.new("Medium stone grey")] = true;
-- [BrickColor.new("Cyan")] = true
--}
-- tried to do this but it wasnt working. sorry bout that
game.Players.PlayerAdded:connect(function(plr)
print("player is added gg")
plr.CharacterAdded:connect(function(char)
local board = api:GetBoardID("Broadview Research and Development")
local listid = api:GetListID("Testing",board)
local list = api:GetCardsInList(listid,board)
print("added yo!!")
if plr.TeamColor == BrickColor.new("White") or plr.TeamColor == BrickColor.new("Medium stone grey") or plr.TeamColor == BrickColor.new("Cyan") and mps:PlayerOwnsAsset(plr,pass1) or mps:PlayerOwnsAsset(plr,pass2) then print("yay ok")
for _,c in pairs(list) do
print("ok then")
if c.name:match('(.*):(.*)') then
n,i = c.name:match('(.*):(.*)')
print(n)
print(i)
if n == plr.Name or i == plr.userId then
print(plr.Name .. " is banned from revolver use")
break
else
wep:Clone().Parent = plr.Backpack
end
end
end
end
end)
end)
Lots of inefficient things that I know how to do but simply wouldn't work. This might need someone experienced to answer. Essentially, the list is to be used as shown here I usually get multiple revolvers even though my name is there. I know I'm doing this completely incorrect but honestly don't know what to do. API is by nstrike159.
