Hello, I am working on a roleplay game and I have stumbled across a problem. I am making it so when a player joins, it clones a room in replicated storage, places it at a random point, and teleports the player to it. However, it is not working. You don’t get teleported, or anything. There is also another problem, there is no way for me to change the cameras cframe on the server to the room’s clone camera part. How can I accomplish these two problems? Here is the script:
Also forgot to mention the room in replicated storage as two parts, one being the part that the player teleports to, one being the camera part, and the other being the floor part.
Alright, so now it works, but I have a second problem. How can I make it so that the player’s camera cframe gets changed to the cframe of the room? I am asking this since I have looked around and it seems its pretty hard to change the cframe on the server.
Use a remote event that fires a localscript which changes the camera’s CFrame (done by workspace.CurrentCamera.CFrame = (yourCFrame), you can’t change the camera’s CFrame on the server.
the local script brackets shouldn’t be the same as the server.
game.ReplicatedStorage.Tpev.OnClientEvent:Connect(function(roomlocation)
-- you can reference the player using game.Players.LocalPlayer
-- the room location reference the room's CFrame
end)```