#ping js
1 messages · Page 1 of 1 (latest)
A fake ping isn't going to fix or do anything with to help your latency.
Get your host to move your server to closer location if one is available.
ping 120 is felt at 40
Read what I said, fake ping isn't going to fix your latency/lag.
I just need fake numbers so that the original number can be subtracted by 50.
why
Please, no questions asked
Create new Js, add:
placeholder = %player_ping%;
And
return(placeholder-50);
Do you need full code?
O.o
did you put it inside a javascript?
or just /papi parse me %math_0:_{player_ping}-50%
because you should do this 
no javascript
okay, make sure you downloaded the expansion

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
woops
PAPI Dump
To generate a PAPI dump, execute the command /papi dump. Then you can copy the link by clicking on it in chat and selecting the COPY LINK button.
@winged berry
yes)
5min
/papi dump gives me information to see why math isn't working
you really don't need javascript for this
and javascript is a lot slower than using the math expansion
Do you have placeholders API?
No - install, and go to the Yes step
Yes - turn on your server, and use /papi ecloud download Player
Now stop your server;
Find \plugins\PlaceholderAPI\javascript_placeholders.yml
and add this:
pingfix: file: pingfix.js
now goto \plugins\PlaceholderAPI\javascripts
and create just new .txt file. Rename it to pingfix.js so it will change it's format to .js open it in notepad++ or sublime text... and add this code:
var placeholder = "%player_ping%"; function placeholderCheck(){ return placeholder-50; } placeholderCheck();
save file. Now start your server and i hope you should be able to use %javascript_pingfix% placegolder
but in general, yes, strange
You can do as you please, but this is very overcomplicated
js laggy but sometimes i use it(
just remember every single time that %javascript_pingfix% is parsed, it will create a new instance of the engine
it's good to use in small quantities
for something like ping, I would advise against it
especially when it's something that can be done using another placeholder, such as math
thanks!
hm
27.0
delete .0
;/
var placeholder = "%player_ping%"; function placeholderCheck(){ return Math.round(placeholder-50); } placeholderCheck();
sorry
wrong reply....
btw on my server im using js to detect group of the player when someone send message to the chat, to add color to the message, i have chat format like:
format: '&7[&aG&7] &r{prefix}{player}{suffix}&7: %javascript_permissioncolor%{message}' don't you think it will be bad for performance?
what is it?
interesting
you can do like %utils_parse_changeoutput_equals_input:{luckperms_has_permission_color.red}_matcher:yes_ifmatch:&c_else:{changeoutput...}%
using the utils expansion to parse nested placeholders
if that makes sense
%utils_parse_changeoutput_equals_input:{luckperms_has_permission_color.red}_matcher:yes_ifmatch:&c_else:{changeoutput_equals_input:{luckperms_has_permission_color.green}_matcher:yes_ifmatch:&a_else:{changeoutput...}}%
okay but ywhy do we need utils?
for the nested placeholders
you will have {changeoutput_{changeoutput_{changeoutput}}} for example
yes
this
number without .0
how can "else" emty string? changeoutput_equals_input:{vault_group}_matcher:mygroup_ifmatch:&7_else:?
strange
thx
without ":"?
var placeholder = "%player_ping%";
function placeholderCheck(){
return (placeholder-50).toFixed();
}
placeholderCheck();
with :
I fixed))
var placeholder = "%player_ping%";
function placeholderCheck() {
return ~~(placeholder - 50);
}
placeholderCheck();
you do whatever you want
I add ~~
i got my longest placeholder ) %utils_parse_changeoutput_equals_input:{vault_group}_matcher:commander_ifmatch:&6_else:{changeoutput_equals_input:{vault_group}_matcher:warlord_ifmatch:&4_else:{changeoutput_equals_input:{vault_group}_matcher:dragon_ifmatch:&x&a&d&0&0&f&f_else:{changeoutput_equals_input:{vault_group}_matcher:creator_ifmatch:&f&l_else:}}}%
do i need to install some extantions for papi? not workning(
changeoutput and utils
and vault
if you need more help, maybe ask in #placeholder-api or make your own thread, best not to keep using this one