Help with Temp-Ban

I have a script in my game that calls a temp-ban function when a player types /tempban. I want to use @waterrunner 's script, but I don’t know how to use it with my script:

local commands = {}

local prefix = "/"

local function findPlayer (name)
	for i, player in pairs(game.Players:GetPlayers()) do
		if string.lower(player.Name) == name then
			return player
		end
	end
	return nil
end

commands.tempban = function(sender,arguments)
	
end

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message,recipient)
		local message = string.lower(message)
		local splitString = message:split(" ")
		local slashCommand = splitString[1]
		local command = slashCommand:split(prefix)
		local commandName = command[2]
		print(commandName)
		
		if commands[commandName] then
			local arguments = {}
			for i = 2, #splitString, 1 do
				table.insert(arguments,splitString[i])
			end
			commands[commandName] (player,arguments)
		end
	end)
end)

How could I create a temp-ban script?

you can use datastore to save the time, and the player userid, you can use os, mainly .time to get the time, now the fun part, when the player is to join the game, using an on join script, check if that player’s userid is in the datastore, if it is, check the time store there, and subtract the two, if it has been long enough, you should be able to remove the store and they can play again.

I think I figured it out myself. Thank you for the help though!