Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to remove a certain key from data store?

Hello.

I have a ban system in my game that uses data store. Is it possible to unban a person from the data store without un banning everyone else?

Code I have (it is part of an admin commands system)

elseif msg:lower():sub(1,4) == ";ban" then
				local obj = msg:sub(6)
				local player = game.Players[obj]
				local ds = game:GetService("DataStoreService"):GetDataStore("Moderation") 
					ds:SetAsync(player.UserId, true)
					wait()
		        game.Players[obj]:Kick("You have been banned!")

Thanks

3 comments

0

Just make a command that sets their datastore to false

0

Weird system, why don't you use tables?

0

I was never fond of using tables

1 answer

✓ Accepted answer

Simply set the data store to false. Then the player should be unbanned (assuming your just doing a check for if it’s true).

ds:SetAsync(ID_HERE, false)

2 comments

0

Thanks

0

No problem

This discussion is preserved as it was. New answers, comments, and votes are closed.