How would I add a chat spam delay?

I am wondering how I would I would make a delay for the chat message so that it doesn’t spam chat like it has been doing the “Press E to slash” spams chat all the time is their a way I can add a delay so the message shows every say 2 mins while next to a car wheel. The rest of the code is good just not sure how to avoid the chat spam.

					if IsVehicleTyreBurst(vehicle, closestTire.tireIndex, 0) == false then
						TriggerEvent("chatMessage", "^3[^1CSRP^3]^7: Press 'E' to slash")
						if IsControlJustPressed(1, 38) then

You should inquire about this on the release post for that resource.

I have tried, no help

My opinion on this is chat message shouldn’t be used, instead you should replace that TriggerEvent to chat with a draw text to the screen function (There are plenty of these examples floating around the forum).

I’m not familiar with the script but I’m assuming you’re only going to hit that “if IsVehicleTyreBurst” statement if you are close to the vehicle tire so walking away or if tire is already burst would have the drawn text go away.

The alternative if you want to keep using chat is a little messy, you’d have to track vehicle handles in a list with a timer value and have a thread loop through that list subtracting time from each vehicles value until it hit zero where. Then you original statement would have to check that list to see if the vehicle handle existed and if the timer value was greater than 0 you would not Trigger the chat event, else you’d trigger the chat event.

I prefer the draw text option myself, it’s cleaner and stuff like this really doesn’t feel right in the chat box.

Which resource is this about? I might take a quick look at it.

Looks like it’s this one and in looking at the code Xander is using a text drawing feature rather than chat messages.

Seems like you are right, it is this resource.

Maybe the OP uses an older version?

You shouldn’t be using a chatMessage for that purpose. You didn’t get help because if you decide to modify a resource at least know how to modify the resource before modifying it?