My problem is that I’m trying to get a player teleported in a specific location and lock his camera. There is “Campart” where the camera is and there is a “Focuspart” where “Campart” is looking. I tried doing this with Remote Events but when I join my game nothing happens and nothing is working. (And I really don’t understand Remote Events even though Im trying my best). I would really appreciate some help from you guys!
Server script

Local script
Edit : Also I renamed my remote event to “RemoteEventCamera”.
You can only change the player’s camera type on a LocalScript in StarterPlayerScripts and you cannot do it on the server.
And where can I exactly put it in Local script?
You need to do the camera manipulation on a local script.
Server:
local RepStorage = game:GetService("ReplicatedStorage")
local RemoteCamEvent = RepStorage:WaitForChild("RemoteEventCamera")
wait(10) -- this was in your original code, so I kept it
for i, v in pairs(game.Players:GetPlayers()) do
v.Character.HumanoidRootPart.Position = Vector3.new(393.627, 0.5, -303.35)
RemoteCamEvent:FireClient(v)
end
Client:
local RepStorage = game:GetService("ReplicatedStorage")
local RemoteCamEvent = RepStorage:WaitForChild("RemoteEventCamera")
RemoteCamEvent.OnClientEvent:Connect(function()
Workspace.Camera.CameraType = "Scriptable" -- not game.Workspace because you need the player's local workspace
Workspace.Camera.CFrame = Workspace.Campart.CFrame -- Fixed this line of code
Hope this helps!
1 Like
Still nothing works. But still thank you for trying to help me!
1 Like