How to change a button to /chat?

Hi, I was wondering how to change pressing a button to typing /startfire in chat. I’m trying to have a fire start when a person types /startfire instead of clicking F9. I got the fire script from here and here is the script;

Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustPressed(1, 56) then – button f9
FSData.originalfiremaker = tostring(GetPlayerPed(-1))

		local x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
		local coords = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
                                      
            
		if not HasNamedPtfxAssetLoaded("core") then
			RequestNamedPtfxAsset("core")
			while not HasNamedPtfxAssetLoaded("core") do
				Wait(1)
			end
		end
		SetPtfxAssetNextCall("core")
		
		
	
		table.insert(FSData.lastamnt, 20)
	
       	local rand = math.random(1, 200)
		if rand > 100 then
			table.insert(FSData.lastamnt, StartParticleFxLoopedAtCoord("ent_ray_heli_aprtmnt_l_fire", x+5, y, z-0.7, 0.0, 0.0, 0.0, 1.0, false, false, false, false))
		else
			table.insert(FSData.lastamnt, StartParticleFxLoopedAtCoord("ent_ray_heli_aprtmnt_h_fire", x+5, y, z-0.7, 0.0, 0.0, 0.0, 1.0, false, false, false, false))
		end
		table.insert(FSData.lastamnt, x+5)
  		table.insert(FSData.lastamnt, y)
       	table.insert(FSData.lastamnt, z-0.7)
	
       	table.insert(fireremover, StartScriptFire (x+5, y, z-0.8, 25, false))
       	table.insert(fireremover, x+5)
       	table.insert(fireremover, y)
       	table.insert(fireremover, z-0.8)
		local firec = {}
		local lastamnt = {}
		local deletedfires = {}
		for i=1,#FSData.firecoords do
			firec[i] = FSData.firecoords[i]
		end
		for i=1,#FSData.lastamnt do
			lastamnt[i] = FSData.lastamnt[i]
		end
		for i=1,#FSData.deletedfires do
			deletedfires[i] = FSData.deletedfires[i]
		end
		local original = tostring(FSData.originalfiremaker)
		if chatStreetAlerts == true then
        	chatAlerts(x, y, z)
    	end
		TriggerServerEvent("lol:firesyncs", firec, lastamnt, deletedfires, original)
		Citizen.Wait(2000)
	end
end 

end)

How can I change it?

That script already has a command to start a fire.

What is it? Because I thought it was just the button?

Here are all of the command
/fire
/firestop
/coords
/firecount
/cbomb
/test
/sync
/firehelp

Oh that’s great! Let me try that