#Temporary ban for application center

1 messages · Page 1 of 1 (latest)

mystic fable
#

Hey!!! I cannot figure out how to make a temporary ban for an app center. I'm just making this for fun but I am super confused. The main thing is I cant find out how to make a datasttore for 24 hrs :(

`local dataStore = game:GetService("DataStoreService")
local players = game:GetService("Players")

local DR = game.ReplicatedStorage.Remotes.DataEvent
local bannedStore = dataStore:GetDataStore("Banned")
local KE = game.ReplicatedStorage.Remotes.KickEvent
local IE = game.ReplicatedStorage.Remotes.IdEvent

game.Players.PlayerAdded:Connect(function(PLR)
    local PV = Instance.new("StringValue")
    PV.Name = "PlayerValue"
    PV.Parent = game.Workspace
    PV.Value = PLR.Name

end)

local PV = game.Workspace:WaitForChild("PlayerValue")

local IVS = game.Players:WaitForChild(PV.Value)

local TimeV = (os.date("%c"))
task.wait(3)
print(TimeV)
local IVS = game.Players:WaitForChild(PV.Value)
local BanTable = {}

if TimeV == TimeV and IVS.Value == 3 then
DR.OnServerEvent:Connect(function(U, N)
game.Players.PlayerAdded:Connect(function()
print(U)
end)
end)
end

local currentTime = os.time()
local newTime = currentTime + 86400
local newDate = os.date("*t", newTime)
print(newDate.year .. "-" .. newDate.month .. "-" .. newDate.day .. " " .. newDate.hour .. ":" .. newDate.min .. ":" .. newDate.sec)

while true do
task.wait(1)
if IVS.Value == 3 then
local PLR = game.Players.PlayerAdded:Connect(function(PLR)
PLR:Kick("3 incorrect answers! Come back at "..newDate)
end)
end
end

IE.OnServerEvent:Connect(function(U, LP, PLRID)
if U == PLRID and IVS.Value == 3 and TimeV == TimeV then
print("Valid Kick.")
table.insert(PLRID)
task.wait(3)
if BanTable[PLRID] then
LP:Kick("3 incorrect answers! Come back at "..newDate)
end
else
print("Invalid")
end
end)

--os.date("%A, %B %d, %X, %Y")`

#

I'd assume my code is messy

#

local dataStore = game:GetService("DataStoreService")
local players = game:GetService("Players")

local DR = game.ReplicatedStorage.Remotes.DataEvent
local bannedStore = dataStore:GetDataStore("Banned")
local KE = game.ReplicatedStorage.Remotes.KickEvent
local IE = game.ReplicatedStorage.Remotes.IdEvent

local TimeV = (os.date("%c"))
task.wait(3)
print(TimeV)

#

I had to delete my other code.

mystic fable
#

alr thankz!!!

#

ill come back if necessary

whole arch
#

Players:BanAsync