Antix

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

2 Neutral

About Antix

  • Rank
    I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Antix

    Lag while spectating players

    The issue is probably that your spectating function is probably only client sided and that is exactly the issue. If you ( localPlayer ) spectate someone in another dimension it will look desynced. If you ( localPlayer ) set your dimension to the spectated players dimension client sided and then spectate it will look desynced. So the only solution is setting the localPlayers dimension server sided to the spectated players dimension and then start spectating.
  2. This functions constantly loops through all players every frame, which is extremly excessive. You could limit the looping to every 500 ms like this: local lastDataSet = 0 local dataSetCooldown = 500 -- in ms exports.scoreboard:scoreboardAddColumn( "Wanted", 45 ) exports.scoreboard:scoreboardAddColumn( "Money", 55 ) function ScoreBoardWanted(thePlayer) -- if getTickCount is smaller than the last time we set the elementdata, return false, else loop through all players and set the cooldown if ( getTickCount( ) < lastDataSet + dataSetCooldown ) then return false end for _,player in ipairs( getElementsByType("player") ) do setElementData ( player, "Wanted", getPlayerWantedLevel ( ) ) setElementData ( player, "Money", getPlayerMoney ( ) ) end lastDataSet = getTickCount( ) end
  3. local theTrailer = getElementData( thePlayer, "Trucker.trailer" ) destroyElement(theTrailer) You are saving the elementdata under the variable "theTrailer" and then you try to use destroyElement on an elementdata, which doesn't work since elementdata is not an element.