Lua raid timer

Hello so ive created a simple lua script that does so only certain jobs can raid using a command but how would i go ahead and make a timer for this so they can only raid with a cooldown of 5 mins since ive never tried this before im asking you guys

timer.Create

Never used a timer before so how would i create so that restricts the command so it can only be used every 5 minutes

Just make the timer 300 seconds long (5 minutes), and then just use

timer.Exists to check if the timer is over yet, and if it is, let them use the command

[editline]2nd August 2016[/editline]

Also, why is your profile picture a picture of some post I did?

No, for something simple like checkign that.
When the person uses the command, check agaist curtime
So when they can run the command do something like
ply.RaidCmdNextUseUse =CurTime() + 5*60

then later when he runs it again you can do
if CurTime()<= ply.LastRaidCmdUse then

Attempt to zoom in went wrong

[editline]2nd August 2016[/editline]

thanks guys im gonna try to test youre methods now

[editline]2nd August 2016[/editline]

heres an example of what you said i think i got it right
if i dident please reply with the correct way


	text = string.lower( text )
	if ( text == "!capture" ) then
			if  ply:Team() ==  marinetable and if CurTime()<= ply.LastRaidCmdUse then
				chat.AddText( Color( 100, 0, 100 ), '[Town] ', Color( 0, 0, 255 ), 'Marines Are Trying To Get The Town Agian')
				ply.RaidCmdNextUseUse =CurTime() + 5*60
				
			elseif ply:Team() == talibantable and if CurTime()<= ply.LastRaidCmdUse then
				chat.AddText( Color( 100, 0, 100 ), '[Town] ', Color( 255, 0, 0 ), 'Talibans Are Taking Over The Town '
		ply.RaidCmdNextUseUse =CurTime() + 5*60
		end
	end

Scratch all of that im posting all my code due to my friend telling me that im doing the tables wrong in the if’s and chat.addtext is only clientside so what would i use instead of chat.addtext


talibantable={}
talibantable[1]=TEAM_*
talibantable[2]=TEAM_*
talibantable[3]=TEAM_*
talibantable[4]=TEAM_*
talibantable[5]=TEAM_*
talibantable[6]=TEAM_*
talibantable[7]=TEAM_*
talibantable[8]=TEAM_*

marinetable={}
marinetable[1]=TEAM_*
marinetable[2]=TEAM_*
marinetable[3]=TEAM_*
marinetable[4]=TEAM_*
marinetable[5]=TEAM_*
marinetable[6]=TEAM_*
marinetable[7]=TEAM_*
marinetable[8]=TEAM_*

ply.RaidCmdNextUseUse =CurTime() + 5*60
hook.Add( "PlayerSay", "CTBCapture", function( ply, text, public )
	text = string.lower( text )
	if ( text == "!capture" ) then
			if  ply:Team() == marinetable and if CurTime()<= ply.LastRaidCmdUse then
				chat.AddText( Color( 100, 0, 100 ), '[Town] ', Color( 0, 0, 255 ), 'Marines Are Trying To Get The Town Agian')
				ply.RaidCmdNextUseUse =CurTime() + 5*60
				
			elseif ply:Team() == talibantable and if CurTime()<= ply.LastRaidCmdUse then
				chat.AddText( Color( 100, 0, 100 ), '[Town] ', Color( 255, 0, 0 ), 'Talibans Are Taking Over The Town ')
		ply.RaidCmdNextUseUse =CurTime() + 5*60
		end
	end
	
			elseif (text == "!Capture")
	if ply:Team() ==  marinetable then
chat.AddText( Color( 100, 0, 100 ), '[Town] ', Color( 0, 0, 255 ), 'Marines Are Trying To Get The Town Agian')
				
	elseif ply:Team() == talibantable then 
chat.AddText( Color( 100, 0, 100 ), '[Town] ', Color( 255, 0, 0 ), 'Talibans Are Taking Over The Town '
		end
	end
end )

------
--  Civilian Multi Raid
------
hook.Add( "PlayerSay", "Multi", function( ply, text, public )
	text = string.lower( text )
	if ( text == "!r" ) then
			if ply:Alive then
				chat.AddText( Color( 100, 0, 100 ), '[Crime] ', Color( 0, 0, 255 ), ..Player( 1 ):Name()..' Has Started a Raid - Kidnap - Mug [5K] ')
				
			else return end
		end
	end
	
			elseif (text == "!R")
	if ply:Alive then
				chat.AddText( Color( 100, 0, 100 ), '[Crime] ', Color( 0, 0, 255 ), ..Player( 1 ):Name()..' Has Started a Raid - Kidnap - Mug [5K] ')
				
	else return end
		end
	end
end )

Why is this funny ;D