HOLY COW! I been scripting for so long and following ton’s of videos. I made so many datastores, but my question is how can I show the admin who banned the person in the ban reason?
if Banned == true then
Player:Kick("You have been banned by a Blossom County moderator. If this was a mistake, please appeal in our Discord server linked below our game. Moderator:"..--Tried to show the moderator who did it, right after this note--Player:GetRankInGroup(15423675) >= 245)
When the person is banned, you need to add an admin param into the database you save the bans on so it can save it.
Also, I need more code since it’s not rlly enough.
DataStoreService = game:GetService("DataStoreService")
DataStore = DataStoreService:GetDataStore("ASLDJAISD")
elseif SplitCommand[1] == ":ban" or SplitCommand[1] == ":Ban" then
local TargetedPlayer = SplitCommand[2]
local Name = game.Players:FindFirstChild(TargetedPlayer)
BanDataStore:SetAsync(______, true)
--Ban Player Datastore
local Banned
local Success, Error pcall(function()
Banned = BanDataStore:GetAsync(________)
end)
if Banned == true then
Player:Kick("You have been banned by a Blossom County moderator. If this was a mistake, please appeal in our Discord server linked below our game. Moderator:"..Player:GetRankInGroup(15423675) >= 245)
--Ban Player Datastore
You should add a setasync for the admin that banned the person. Define whoever ran that command (player object) and add it sort of like this BanDataStore:SetAsync(“admin”, admin.Name) replace admin.Name with the player object you have defined
it uses values? because u can edit script to add another value instead that banned user value then edit that ban message to You have been banned by a Blossom County moderator. If this was a mistake, please appeal in our Discord server linked below our game. Moderator: "..plrbanvalue:WaitForChild("moderator").Value
above the command script u can do
local moderator = Instance.new(“IntValue”,bannedplayer)
moderator.Name = “MODERATORWHODID”
moderator.Value = Player.Name
BanDataStore:SetAsync("admin", Player.UserId)
--then when they are kicked:
Player:Kick("You have been banned by a Blossom County moderator. If this was a mistake, please appeal in our Discord server linked below our game. Moderator:"..BanDataStore:GetAsync("admin"))
-- Roblox Creator Docs is your friend!
elseif SplitCommand[1] == ":ban" or SplitCommand[1] == ":Ban" then
local TargetedPlayer = SplitCommand[2]
local Name = game.Players:FindFirstChild(TargetedPlayer)
BanDataStore:SetAsync("Admin", Name.UserId, true)
if Banned == true then
Player:Kick("You have been banned by a Blossom County moderator. If this was a mistake, please appeal in our Discord server linked below our game. Moderator:"..BanDataStore:GetAsync("admin"))
Store that data, either their name or UserId (so, via certain functions, you can get their updated name at the time the player joins). I assume you are using the <Player>.Chatted signal. This means you already have access to the Player DataModel.
As part of the data you are storing (such as the player who is banned, the reason, etc, you can also store data about the individual who did ban them.