#Timed ghosting not working
1 messages · Page 1 of 1 (latest)
It's probably broken.
Maybe it'll be fixed one day
Very low prio from me, cause it's annoying to debug ghosting lol
I feel that lol Ive been trying to debug all day
Keep an eye on #patch-notes and maybe it'll be fixed some day if I can be arsed 
I think I fixed it, when testing I’ll post the code in a bit
local function initGhosting()
debugLog('Initializing ghosting with time: ' .. tostring(CurrentRaceData.GhostingTime))
ghostPlayer() -- Set player as ghosted immediately
-- Handle timed ghosting if GhostingTime is set
if CurrentRaceData.GhostingTime and CurrentRaceData.GhostingTime > 0 then
CreateThread(function()
local ghostEndTime = GetGameTimer() + (CurrentRaceData.GhostingTime) -- Convert seconds to milliseconds
while CurrentRaceData.Started and GetGameTimer() < ghostEndTime do
checkAndDisableGhosting() -- Check proximity while timer runs
Wait(Config.Ghosting.DistanceLoopTime)
end
if CurrentRaceData.Started then
debugLog('Ghosting timer expired, un-ghosting player')
unGhostPlayer()
end
end)
else
-- Fallback to continuous proximity checking if no time is set
CreateThread(function()
while CurrentRaceData.Started do
checkAndDisableGhosting()
Wait(Config.Ghosting.DistanceLoopTime)
end
end)
end
end```
Niice!
I'll take a look at it, see if I can simplify it for a release sometime later