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

Is there a better way of doing this instead of firing server too much??

Asked by 5 years ago

I need constant replication of the object's position between client and server and I found this to be the best way to do it. Any other solutions?

game:GetService("RunService").RenderStepped:Connect(function()
    if not RenderDebounce then
        RenderDebounce = true
    if target and target:FindFirstChild("Gravity") and target.Anchored == false and target:GetMass() < 250 and (target.Position - Tool.Emitter.Position).magnitude < 10 then
            Attach:FireServer()
            local obj = target
        if obj then
            obj.Position = Tool.Emitter.Position
    end
    end
    RenderDebounce = false
    end
end)

Answer this question