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

Joints won't replicate in FilteringEnabled?

Asked by 8 years ago

I'm trying to make it so that when you're in first person (you're always in first person) that when you equip this tool, your arms follow your cursor. Since I want it the joints to update on the server so that other players can see where my arms are pointing, it needs to update on the server. But I have to run it through a localscript because I need to use the camera for this. Since this is going to be done with all tools, I'm using a module for the function. Here are the functions in the module:

it works fine on the client, but it STILL won't update on the server:

Module script: local runservice = game:GetService("RunService")

local leftShoulder local rightShoulder local cam

local function armsLoop() leftShoulder.C0 = CFrame.new(leftShoulder.C0.p) * CFrame.Angles(cam.CoordinateFrame.lookVector.Y + math.rad(90), -math.rad(90),0) rightShoulder.C0 = CFrame.new(rightShoulder.C0.p) * CFrame.Angles(cam.CoordinateFrame.lookVector.Y + math.rad(90), math.rad(90),0) end

function joints:ArmsMoving(torso, camera, move) cam = camera leftShoulder = torso["Left Shoulder"] rightShoulder = torso["Right Shoulder"]

if move then
    runservice:BindToRenderStep("ArmsLooping", Enum.RenderPriority.Camera.Value-1, armsLoop)
else
    runservice:UnbindFromRenderStep("ArmsLooping")

    leftShoulder.C0 = CFrame.new(leftShoulder.C0.p) * CFrame.Angles(0, -math.rad(90),0)
    rightShoulder.C0 = CFrame.new(rightShoulder.C0.p) * CFrame.Angles(0, math.rad(90),0)
end

end

Local script: ReturnJoints.OnClientInvoke = function(move) if move then JointModule:ArmsMoving(char.Torso, camera, true) else JointModule:ArmsMoving(char.Torso, camera, false) end print('left shoulder - '..tostring(leftShoulder.C0)) print('right shoulder - '..tostring(rightShoulder.C0)) return leftShoulder.C0, rightShoulder.C0 end

Server script: leftShoulder, rightShoulder = ReturnJoints:InvokeClient(player, true) --// MAKE ARMS MOVE print('left shoulder is '..tostring(leftShoulder)) print('right shoulder is '..tostring(rightShoulder)) char.Torso["Left Shoulder"].C0 = leftShoulder char.Torso["Right Shoulder"].C0 = rightShoulder

Server output: left shoulder is -1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0 right shoulder is 1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0

So the CFrames seem(?) to replicate but setting them won't work!

0
Sorry for the messy post! It seems all of it didn't get posted as a snippet. RecurringNightmare 0 — 8y
0
Turn on PrintFilters in Studio settings and see what it outputs. gskw 1046 — 8y
0
http://prntscr.com/bdiw60 I get that spammed in local output and then in server output it didn't output anything related to this. My require()s for my private modules suddenly broke. RecurringNightmare 0 — 8y
0
http://prntscr.com/bdj178 Ignore the stuff about modules, studio just logged me out. This is spammed in the local log, but nothing related to this in the server log. RecurringNightmare 0 — 8y
0
Changes to the Character should indeed replicate to the server. I don't see anything wrong with the script either. gskw 1046 — 8y

Answer this question