Discuss Scratch

Falloutcreatesgames
Scratcher
7 posts

help with ping counter??

Im trying to make a ping counter for server response but i cant seem to figure out how to do that

when green flag clicked
reset timer
set [previous timer] to [0]
forever
set [ping] to ((1) / ((timer) + (previous timer)))
end

same as fps i guess

Last edited by Falloutcreatesgames (Feb. 2, 2022 18:36:56)

Rangnarok
Scratcher
29 posts

help with ping counter??

For fps I do
when green flag clicked
forever
set [fps] to ((1) / (timer))
reset timer
end

when green flag clicked
forever
play [Minecraft]
play [Hollow Knight]
play [Undertale]
play [Deltarune]
play [TLoZ BotW]
play [TLoZ TotK]
play [It Takes Two]
play [Geometry Dash]
play [Terraria]
code [Scratch]
code [C#]
end

when [russia] > [ukraine]
if <[russia] invades [ukraine] ?> then
repeat until <([state] of[russia]) = [peace]>
̶p̶e̶n̶ foot down
replace item [state] of [putin] with [snitch]
globally [protest]
end
end

RUUUUNNN ITS THE EVIL KUMQUATS













You didnt need to scroll all the way down here btw…
Arzenist
Scratcher
98 posts

help with ping counter??

Rangnarok wrote:

For fps I do
when green flag clicked
forever
set [fps] to ((1) / (timer))
reset timer
end

That’s fps not ping, ping is different, it measures the connection between the server and the player, this is only used in multiplayer, so your not going to need it if your not doing a cloud game

Last edited by Arzenist (Feb. 12, 2022 20:02:43)

aaroj123
Scratcher
38 posts

help with ping counter??

you can use this if you want

https://scratch.mit.edu/projects/643446621/
https://scratch.mit.edu/projects/643984400/
this measures the time from when you sent a ping to another player to when you get a ping sent back

i don't know how reliable this is but it should work
(it uses 2 cloud variables)

Last edited by aaroj123 (Feb. 14, 2022 10:10:58)




——————————————
Coding
Making stuff
Helping with scripts
——————————————


——————————————

Powered by DjangoBB