MitnickP56 Posted January 5, 2016 Share Posted January 5, 2016 Hello I tried to make script : if player ping >= 100 then show on chat: NamePlayer has big ping : (ping (101,111,478,5837) smth like this just show on chatbox. Please help with it. function detektor() for i, player in ipairs(getElementsByType("player")) do if (getPlayerPing(player) >= 100) then outputChatBox(player, "Lagging ping:"getPlayerPing) end end end setTimer(detektor, 2000, 0) Link to comment
ALw7sH Posted January 5, 2016 Share Posted January 5, 2016 function detektor() for i, player in ipairs(getElementsByType("player")) do if (getPlayerPing(player) >= 100) then outputChatBox(player, "Lagging ping:"..getPlayerPing(player)) end end end setTimer(detektor, 2000, 0) Link to comment
GTX Posted January 5, 2016 Share Posted January 5, 2016 (edited) outputChatBox(player, "Lagging ping:"..getPlayerPing(player)) This is wrong. Correct (full): function detektor() for i, player in ipairs(getElementsByType("player")) do if (getPlayerPing(player) >= 100) then outputChatBox(getPlayerName(player).." is lagging: "..getPlayerPing(player), root, 255, 255, 255, true) end end end setTimer(detektor, 2000, 0) Edited January 5, 2016 by Guest Link to comment
MitnickP56 Posted January 5, 2016 Author Share Posted January 5, 2016 function detektor() for i, player in ipairs(getElementsByType("player")) do if (getPlayerPing(player) >= 100) then outputChatBox(player, "Lagging ping:"..getPlayerPing(player)) end end end setTimer(detektor, 2000, 0) debugscript: Link to comment
ALw7sH Posted January 5, 2016 Share Posted January 5, 2016 I haven't noticed that "player" at argument one function detektor() for i, player in ipairs(getElementsByType("player")) do if (getPlayerPing(player) >= 100) then outputChatBox(getPlayerName(player).." Lagging ping: "..getPlayerPing(player),root) end end end setTimer(detektor, 2000, 0) Link to comment
MitnickP56 Posted January 5, 2016 Author Share Posted January 5, 2016 Working. Rly Thanks. Link to comment
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