I don’t think it’s unbanning. Is this meant to work in Studio?
If this appear in the output when you did the ban command. Then add a print(IsBanned) below it to check If the datastore was succesfully changed to true.
Do this
local IsBanned = BanStore:GetAsync(plr.UserId)[1]
l
print(IsBanned)
and change the SetAsync from ban command to this
BanStore:SetAsync(PlayerInCommand.UserId, true)
This error is happening on line 24
ServerScriptService.Blox.Modules.Script:24: attempt to index boolean with number
the line
local IsBanned = BanStore:GetAsync(plr.UserId)[1]
First of all, why it’s on the line 24?
And, try to do:
local BanData = BanStore:GetAsync(plr.UserId)
local IsBanned = BanData[1]
I’m banning myself, the print value comes out true.
But when I rejoin, I’m not getting kicked???
This is on the script?
If IsBanned then
plr:Kick("Banned")
Yep.
There’s the issue. You’re not checking the boolean correctly. Change IsBanned to this and then do the If statement.
Weird… do print(IsBanned)
below local IsBanned
I have to be somewhere. I’ll test it when I get home.
To me it seems like you are trying to find the unbanned player in-game by checking if they’re in game.Players, but assuming they’ve been kicked this would not work as they’d never be in game.Players. maybe try remove this check and just find userid by username?
Could you provide an example? I’m unsure how to do that.
Do you mean just remove the checks I implemented and just unban the player?
Yeah, remove the check that checks if the player is in game.Players, because if a player were banned they wouldn’t be in the game
Right now, I’m currently having trouble even getting the data store to remember that I’m banned.
Still waiting for a solution to this issue.