i have a custom movement script, so walking and jumping and stuff like that sets velocity on the client, but i have no idea how to replicate it to the server so it will be smooth enough and i don’t think remoteevents will work for this
Try remote events maybe it can work.
You should store the velocity value on the server and replicate the server to the client otherwise the client will be able to set the velocity using exploits.
to calculate the velocity on the server, you will have to update player’s view angles every tick. thats already not possible without having it laggy
If you can’t find a way to do it serverside then make sure to check the validity of the data sent by the client.
but i am trying to find out how to send data smoothly from the client first!!
Use RemoteEvents to send data from client to server.
just so you know, theres a limit of 20 remoteevent fires every second, i dont know if thats enough for me i guess i will just try it
Why do you need to send info from the client to the server every tick? Character movement is automatically replicated by Roblox.
thats not the problem, i wanna add a mechanic that requires another players velocity
You can use Values inside the Player instances.
How are you updating the player’s velocity? If it is through WalkSpeed, you can simply grab it directly from the server as any changes done to the Humanoid on the client is automatically replicated to the server.
Why do you need the server for this tho? You can get everything on the client. If you wanna make it harder to exploit then check every few seconds on the server.
yeah i just found out if you set velocity on any part that you own, it replicates to everyone, you think its gonna be fine to make a part on the server that clients will set their velocities on?
Idk what you mean exactly. If you create a part on the server, a client can take Networkownership of the part and all the physics will be calculated on the client.
thats what i did, now client sets a parts velocity and all other clients can get it and use that
Ok then mark this post as solved, and make sure to check the Velocity on the server every now and then.