freudo Posted July 30, 2017 Posted July 30, 2017 Hello friends, I have a problem. I have a little delay when I watch the player. Code: function randomSpectatePlayer() local playerGroup = getElementData(localPlayer, "player:group") or false if playerGroup then local inGame = getElementData(localPlayer, "player:game") or false for k,v in ipairs(playerGroup) do if isElement(v) and getElementData(v, "player:game") and getElementData(localPlayer, "player:onSpawn") then if v ~= localPlayer then setElementFrozen ( localPlayer, true ) oldDim = getElementInterior(localPlayer) oldInt = getElementDimension(localPlayer) setElementInterior(localPlayer, getElementInterior(v)) setElementDimension(localPlayer, getElementDimension(v)) setCameraInterior(localPlayer, getCameraInterior(v)) spectating = v setCameraTarget ( v ) outputChatBox("[SPECTATE] #ffffffYou spectating now "..getPlayerName(v), 255,100,100,true) outputChatBox("[SPECTATE] #ffffffIf you want back to lobby use #ff0000/back #ffffffcommand.", 255,100,100,true) addCommandHandler("back", onStopSpectating) end end end end end WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
Mr.Loki Posted July 30, 2017 Posted July 30, 2017 Probably lag... what's the ping of the player that you are watching? [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
freudo Posted July 30, 2017 Author Posted July 30, 2017 I think distance delay, how I can fix it? WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
MisterQuestions Posted July 30, 2017 Posted July 30, 2017 (edited) Well your topic talks about a function you don't even use, how ever you also should break the loop. Edit: The delay may be caused cause loop and way you get data, you should organize more such spectator system otherwise lag will keep, is really needed do all such things everytime you call to a random spectate target? Edited July 30, 2017 by MisterQuestions 1 "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
freudo Posted July 30, 2017 Author Posted July 30, 2017 yes it's random. WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
MisterQuestions Posted July 31, 2017 Posted July 31, 2017 15 minutes ago, barikat said: yes it's random. Seems like you don't even understand what i said. "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now