Rotate player’s camera on touch WITHOUT local script

I don’t want to use localscript for this because everything will break
What is wrong with this script?? camera cframes are different but nothing is happening in game {before the line 19 and after}

local active = false
local activeli2 = {}

script.Parent.Touched:connect(function(hit)
	local findhum = hit.Parent:FindFirstChild("Humanoid")
	local whois = hit.Parent
	if whois:FindFirstChild("Humanoid") and not activeli2[whois.Name] then
		activeli2[whois.Name] = true
		if findhum then
			local player = game.Players:GetPlayerFromCharacter(hit.Parent)
			findhum.Jump = true
			wait(0.05)
			local vorona = whois:FindFirstChild("HumanoidRootPart")
			--findhum.PlatformStand = true
			vorona.CFrame *= CFrame.Angles(0, math.rad(180), 0)
			task.wait(0.05)
			print(whois)
			print(workspace.CurrentCamera.CFrame)
			workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.Angles(math.rad(180), 0, 0)
			print(workspace.CurrentCamera.CFrame)
			task.wait(0.33)
			--findhum.PlatformStand = false
		end
		wait(0.5)
		activeli2[whois.Name] = false
	end
end)

You can’t access the CurrentCamera from a ServerScript. To get a client camera, you need to use a localscript.

I suggest you to use a remoteevent to update the camera from the server.

1 Like

Yeah hate to break it to you you gotta do it on the client. Instead can you show us how doing it on the client is breaking? We could help with that!

1 Like

thanks, but working with local scripts and remote events would take too much time. I will just leave it like this

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.