Hello I need some help the fire server is not working! It shows me the prints on the server but the lean function doesn’t work! and you can’t see it on the server either (the player lean function), what’s wrong? I’ve been with this for 3 days and nobody helps me.
client side:
local function playerLookUpDown(active)
if active == true then
print('its active!')
-- get useful motor6ds
local root = motors["RootJoint"]
local leftHip = motors["LeftHip"]
local rightHip = motors["RightHip"]
-- get angles of camera
local y, x, z = camera.CFrame:ToEulerAnglesYXZ()
local groundOffset = math.abs(0.5 * torso.Size.Y - 0.5 * torso.Size.Z) * math.abs(math.sin(y))
-- rotate motor6ds
root[1].C0 = root[2] * CFrame.fromEulerAnglesYXZ(-y, 0, 0) * CFrame.new(0, 0, -groundOffset)
leftHip[1].C0 = leftHip[2] * CFrame.fromEulerAnglesYXZ(0, 0, y)
rightHip[1].C0 = rightHip[2] * CFrame.fromEulerAnglesYXZ(0, 0, -y)
elseif active == false then
print('its not activated')
end
end
-- connections
local connection = RunService:BindToRenderStep("updateMotors", Enum.RenderPriority.Character.Value, playerLookUpDown)
uis.InputBegan:Connect(function(input)
-- Activate camera buttons
if input.KeyCode == Enum.KeyCode.T and isClassicCamera == true then
print('Classic Mode Activated')
-- do something
ZoomOut(minZoomAttribute_FPS, maxZoomAttribute_FPS) -- 10, 70
removeLimitCameraUpDown()
uis.MouseIconEnabled = true
isClassicCamera = false
elseif input.KeyCode == Enum.KeyCode.T and isClassicCamera == false then
print('FPS Mode Activated')
-- do something
player.CameraMode = Enum.CameraMode.LockFirstPerson
player.Character.Humanoid.CameraOffset = Vector3.new(0, -0.4, -0.2)
uis.MouseIconEnabled = false
limitCameraUpDown(minCameraAttribute_FPS, maxCameraAttribute_FPS) -- -34, 150
if isClassicCamera == false then
for _,v in pairs(character:GetChildren()) do
antiTrans(v, true)
end
end
lookDownEvent:FireServer(connection)
isClassicCamera = true
end
-- Run animation play
if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.S or input.KeyCode == Enum.KeyCode.A or input.KeyCode == Enum.KeyCode.D then
runAnimationTrack:Play()
runAnimEvent:FireServer()
end
end)
server side:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local runAnimEvent = ReplicatedStorage:WaitForChild("PlayRunAnim")
local lookDownEvent = ReplicatedStorage:WaitForChild("lookDownEvent")
local players = game:GetService("Players")
local player = players.LocalPlayer
runAnimEvent.OnServerEvent:Connect(function()
print('Connected to server!')
end)
lookDownEvent.OnServerEvent:Connect(function(connection)
print('Connected to server!')
print('look down works')
end)