--i am feeling so friendly right now local cv_friendshiprings = CV_RegisterVar({ name = "friendshiprings", defaultvalue = "On", flags = CV_NETVAR, PossibleValue = CV_OnOff }) -- NetVar to store our rings local ghostLines = {} addHook("NetVars", function(net) ghostLines = net($) end) -- Function to spawn one "ring" at a specific point local function spawnGhost(x, y, z) if cv_friendshiprings.value then local a = P_SpawnMobj(x, y, z, MT_GHOST) a.sprite = SPR_RING a.frame = A a.tics = 1 return a end return nil end -- Function to check if a player is valid local function isPlayerValid(player) return player and player.valid and player.mo and player.mo.valid end -- Function to create/update the line of rings local function updateGhostLineBetweenPlayers(player1, player2, index) local mo1, mo2 = player1.mo, player2.mo local startX, startY, startZ = mo1.x, mo1.y, mo1.z + mo1.height/2 local endX, endY, endZ = mo2.x, mo2.y, mo2.z + mo2.height/2 -- Calculate step sizes for 5 segments (6 points including start and end) local stepX = (endX - startX) / 5 local stepY = (endY - startY) / 5 local stepZ = (endZ - startZ) / 5 -- Create or update 5 ghosts along the line if not ghostLines[index] then ghostLines[index] = {} end for i = 1, 5 do local ghostX = startX + stepX * i local ghostY = startY + stepY * i local ghostZ = startZ + stepZ * i if cv_friendshiprings.value then if not ghostLines[index][i] or not ghostLines[index][i].valid then ghostLines[index][i] = spawnGhost(ghostX, ghostY, ghostZ) else P_MoveOrigin(ghostLines[index][i], ghostX, ghostY, ghostZ) end else -- Remove ghosts if friendshiprings is off if ghostLines[index][i] and ghostLines[index][i].valid then P_RemoveMobj(ghostLines[index][i]) ghostLines[index][i] = nil end end end end -- Main function to update ghost lines between player pairs local function updateGhostLinesBetweenPlayers() for i = 0, 30, 2 do local player1 = players[i] local player2 = players[i + 1] if isPlayerValid(player1) and isPlayerValid(player2) then updateGhostLineBetweenPlayers(player1, player2, i/2 + 1) else -- Remove ghosts if players are not valid if ghostLines[i/2 + 1] then for _, ghost in ipairs(ghostLines[i/2 + 1]) do if ghost and ghost.valid then P_RemoveMobj(ghost) end end ghostLines[i/2 + 1] = nil end end end end addHook("ThinkFrame", function() updateGhostLinesBetweenPlayers() end) --wat the sigma