I already made a separate post about this but no one else appeared to answer. Long story short, making mod gui, ban button upon pressing says “DataStore Request was added to queue”, I also have a problem where it kicks me instead of the playerToBan but when I add playerToBan instead of player… It errors saying that I attempted to call a nil value…
Code :
ban.OnServerEvent:Connect(function(player, playerToBan, reason)
if not table.find(ADMIN, player.UserId) then return end
playeruserID = getUserIdFromUsername(playerToBan)
if playeruserID == 1 then
print("Cannot Ban This User!")
return
else
local success, errormessage = pcall(function()
BanData:SetAsync(playeruserID, reason)
end)
if success then
if game.Players:FindFirstChild(playerToBan) then return end
playerToBan:Kick(reason)
end
end
end)