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

Replicating torso cframe tween on the server?

Asked by
Chronomad 180
8 years ago
Edited 8 years ago

I have a LOCAL script that should match the orientation of the players torso to the camera. It's rather self explanatory and works on the client. However I don't know how to have the effect appear on the server. Thanks in advance for any help!

plr = game.Players.LocalPlayer
    repeat wait() until plr.Character
        local char = plr.Character
    game["Run Service"].RenderStepped:connect(function()
    local c = game.Workspace.CurrentCamera
    char.ChestJoint.Rotator.C0 = CFrame.new(0.9,0,0) * CFrame.Angles(6.5,math.acos                  ((c.CoordinateFrame.p - c.Focus.p).Unit.Y) + -1.5,0,0)
    char.ChestJoint.Rotator.C1 = CFrame.new(0,0.01,0) * CFrame.Angles(0,0,0)
    end)

0
Not quite sure what you are asking. :GetRenderCFrame() might help. MisaMiner 50 — 8y
0
Wait, I just realised that you made the variable char local, which means that it can only be accessed in that loop. You have to define the char variable before the loop or make it a global variable for that to work right. MisaMiner 50 — 8y

Answer this question