I recently discovered that when there are more than two players on a server, scripts are really laggy and don't respond instantly, they work just fine in the studio and moderately fine when Im the only one in the server, but when there's another player everything bugs out. because of FE alot of the models run by clickdetectors, those and scripts in charge of bodyvelocity/angularvelocity are the ones that lag so much, most of the GUIs work perfectly. is there a way to speed up script responses?

script for a seat that moves around:

seat = script.Parent velocity = seat.BodyVelocity bg = seat.BodyAngularVelocity

while true do if seat.Throttle == 1 then velocity.velocity = seat.CFrame.lookVector * 20 end if seat.Throttle == 0 then velocity.velocity = seat.CFrame.lookVector * 0 end if seat.Throttle == -1 then velocity.velocity = seat.CFrame.lookVector * -20 end if seat.Steer == 1 then bg.angularvelocity = Vector3.new(0,-2,0) end if seat.Steer == -1 then bg.angularvelocity = Vector3.new(0,2,0) end if seat.Steer == 0 then bg.angularvelocity = Vector3.new(0,0,0) end wait() end

problem:the seat does not respond instantly, all movement is delayed.(btw I tried organizing the script for you to read easier but I cant)

5 comments

0

Maybe if you posted the code?

0

You might want to consider giving client control of objects using body movers https://www.robloxdev.com/articles/Network-Ownership

2

Formatted version of OP's code: https://pastebin.com/RxuDvqkd

0

Wow, how did you know?

0

Vulkarin, you mean with remote events right?