how to define player’s cam in a server script please i rlly need the answer
im trying to make this script set the player face the front:
local prox = script.Parent
local part = prox.Parent
prox.Triggered:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:FindFirstChildOfClass("Humanoid")
if humanoid then
char:MoveTo(part.Position)
humanoid.WalkSpeed = 0
end
end)
The local players camera is client sided, which means u cant access it on the server
you can use a local script to get the player camera workspace.CurrentCamera
and use a remote event to get it from a script
local:
local cam = workspace.CurrentCamera
RemoteEvent:FireServer(cam)--so it gives the cam
server
RemoteEvent.onServerEvent:Connect(function(Player, cam)
--do stuff
but im not sure if you can get the current camera on the server
1 Like
This won’t work since the Camera only exists for the client.
To influence the camera from the server use a remote event which runs a function on the client.