MitnickP56 Posted January 5, 2016 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)
ALw7sH Posted January 5, 2016 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)
GTX Posted January 5, 2016 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 Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
MitnickP56 Posted January 5, 2016 Author 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:
ALw7sH Posted January 5, 2016 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)
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