I am trying to fix this problem but I get so confused please help me. If it is possible please Help.
Yes it is possible
Here is an example:
01 | --Server Script |
02 | local datastore = game:GetService( "DataStoreService" ):GetDataStore( "Bans" ) |
03 |
04 | game.Players.PlayerAdded:connect( function (plr) |
05 | local key = "user_" .. plr.UserId |
06 |
07 | local banned = Instance.new( "BoolValue" , plr) |
08 | banned.Value = datastore:GetAsync(key) or false |
09 | banned.Name = "Banned" |
10 |
11 | if banned.Value = = true then |
12 | plr:Kick( "You have been banned!" ) |
13 | end |
14 |
15 |
how can the code you posted be made to ban players if they try to use commands?