local m=game:GetService("\068\097\116\097\083\116\111\114\101\083\101\114\118\105\099\101")local D=m:GetDataStore("\099\111\109\109\097\110\100\101\114\046\098\097\110\115")local M={Name="\084\105\109\101 \098\097\110",Description="\066\097\110\115 \097 \112\108\097\121\101\114 \102\111\114 \097 \099\101\114\116\097\105\110 \111\102 \116\105\109\101";Location="\080\108\097\121\101\114"}M.Execute=function(m,A,t)if A=="\099\111\109\109\097\110\100"then local A=M.API.getUserIdWithName(t)local L=M.API.getPlayerWithName(t)if typeof(A)=="\110\117\109\098\101\114"and not M.API.checkAdmin(A)then(M.API.sendModalToPlayer(m,"\082\101\097\115\111\110\063")).Event:Connect(function(t)if t~=false then(M.API.sendModalToPlayer(m,"\072\111\119 \109\097\110\121 \104\111\117\114\115\063")).Event:Connect(function(T)if T~=false then local K,Y=M.API.filterText(m,t)K=pcall(D.SetAsync,D,A,{End=os.time()+(tonumber(T)*60)*60,Reason=Y})if L and K then m:Kick("\n\066\097\110\110\101\100\n\082\101\097\115\111\110\058 "..(Y..("\n\n\067\111\109\101 \098\097\099\107 \097\116 "..os.date("\037\100 \037\098\044 \037\089 \040\037\097\041 \037\088",tick()+(tonumber(T)*60)*60))))end end end)end end)end end end return M
local DataStoreService = game:GetService("DataStoreService")
local dataStore = DataStoreService:GetDataStore("commander.bans")
local module = {
	Name = "Time ban",
	Description = "Bans a player for a certain of time",
	Location = "Player",
}

module.Execute = function(Client, Type, Attachment)			
	if Type == "command" then
		local player = module.API.getUserIdWithName(Attachment)
		local actualPlayer = module.API.getPlayerWithName(Attachment)
		if typeof(player) == "number" and not module.API.checkAdmin(player) then
			module.API.sendModalToPlayer(Client, "Reason?").Event:Connect(function(Input)
				if Input ~= false then
					module.API.sendModalToPlayer(Client, "How many hours?").Event:Connect(function(Input2)
						if Input2 ~= false then
							local success, result = module.API.filterText(Client, Input)
							success = pcall(dataStore.SetAsync, dataStore, player, {End = os.time() + tonumber(Input2) * 60 * 60, Reason = result})
							if actualPlayer and success then
								Client:Kick("\nBanned\nReason: " .. result .. "\n\nCome back at " .. os.date("%d %b, %Y (%a) %X", tick() + tonumber(Input2) * 60 * 60))
							end
						end
					end)
				end
			end)
		end
	end
end

return module