Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Will this function replicate to the server so all players can see whats happening to the brick?

Asked by 8 years ago
Edited 8 years ago

Hi, I have this function

game:GetService("RunService").RenderStepped:connect(function()
    if(keyHit == 'W')then
        obj.BodyVelocity.Velocity = obj.CFrame.lookVector*speed
        obj.BodyVelocity.P = 1250
        obj.BodyVelocity.MaxForce = Vector3.new(3000,3000,3000)
    end

I use render stepped so the objects CFrame is constantly updated. However, I then have to put htis in a local script. However, I want to make sure that everyone can see that the brick is turning. In the function, I am changing the brick's BodyVelocity property, so I'm wondering if the local script changing that will replicate the effect to the server?
Or will I have to put in a remote event inside the if statement that will fire every frame to the server, and then in a server script change the brick's velocity? Thanks!

0
You forgot 2 end's which is "end", "end)" DarkendVabbles 0 — 8y
0
It was a quick snippit of my code, the full script has the both ends, thanks though! SilentAim 36 — 8y
0
When asking, make sure you post everything, cuz everything gets checked by us XD RubenKan 3615 — 8y
0
No. Changes made with a LocalScript will not affect the server. You must make a server script to change obj's velocity and use a RemoteEvent to tell the server script when to do so. tkcmdr 341 — 8y

Answer this question