[Release] Timetrials - Modify Laps and Endurances

This is modify version of [Release] Timetrials - Standalone Races and Leaderboard [v1.00]
This version adds timetrials races with the following features:

  • Laps, Fly lap and Rolling lap
  • Endurances setup
  • Refuse player to race if using motocycle
  • TEXT HUD for Laps, Timer, Checkpoint (if set fly lap and rolling lap = true it will show in HUD too)
  • Calculate time to show in minute not millisecond (not accurate but acceptable)

for Laps,Flylap and Rollinglap you can set separate for each race in track.lua file.
for Endurances you can’t set time separate for each race (i don’t have time to do it), you need to set the time in client.

Download

1 Like

Heya. There seems to be an issue:
[ script:timetrials] SCRIPT ERROR: @timetrials/timetrials_sv.lua:107: attempt to index a nil value (local ‘Itemx’)
Also it doesn’t seem to be able to create any file (json or text) where it stores the track time.

local Itemx = xPlayer.getInventoryItem(“x2_card”)

this is just a item to double the money you earn from race if you have the item
just replace it with this function if you don’t want to have a double reward item
or just make it give item instead

function addMoneymoney(xPlayer)
        xPlayer.addMoney(50000) -- any amount you want to give after finish race
end

and about the score file you can find it here
*you need to do at least 1 race so script can create the file
image

this is unoptimize version cuz i have no time and it’s very old script that i make 2 years ago

for more help you can DM me in discord : alexandre_7059

1 Like

update fix some error