BeamMPTrigger question

Hello, I’ve been trying to create a timing system from point A to point B (starts the timer on point A, ends it on point B) with BeamNGTriggers and they’re pretty tricky, and i couldn’t really find much on the internet. I’ve placed triggers at the start and the end and tried making it work all day. I have no idea what could be the problem.

Can anyone help?

I’ve tried modifying RaceMP too but it’s just also outdated

Basic principle: when car goes trough any beamngtrigger it starts the time and tells me it started the time and when i go trough any beamngtrigger again it stops the time and tells me the time

(Sry i couldn’t provide my code, it’s kinda broken and i’m away for a bit)

I just started modding on BeamMP/BeamNG, and it took me like 12 hours to figure out how to get a trigger to send data to a server script, but heres what I got.

In the trigger’s luaFunction property:

function trigger(data)
if data.event == "enter" then
		TriggerServerEvent("JakeRacing", "FinishLine")
	end
end
return trigger

Make sure to change the values. The first one is the name of your event. The second one is whatever you want to send to the server script. For now im just sending enough info for the script to know what trigger was hit.

Now in the server script

function jakeRacingMain(plr, data)
-- Your Code Here
end
MP.RegisterEvent("JakeRacing","jakeRacingMain")

Again make sure to change the values if you need to.

This is my first forum post here, so I hope this helps you and anyone else trying to figure out the same thing.