basically, i have a round system (server script) and once the map is picked, or the game starts, a cutscene should play, but i dont know how i should set every players camera to the part once the game starts, im guessing its the use of remote events? im not experienced with using them what-so-ever
Remote events would be the easiest because all cameras are local, you can even FireAllClients() and you don’t even need to do a loop or anything. You said you weren’t experienced with them, but this is a great place to learn. You can have a local script listening for that event and when it’s fired with FireAllClients() from the server start the tween and everyone’s camera will be relatively in sync (of course lag and ping will affect server-client communication and vice versa).
u̶g̶h̶ ̶i̶ ̶h̶a̶t̶e̶ ̶r̶e̶m̶o̶t̶e̶ ̶e̶v̶e̶n̶t̶s̶
i changed the server script a little:
dont steal my code >:(
so thats the listening for it, then i should fire from the local script?
and now on the local script i have no idea what to do:
(literally the local script, in StarterCharacterScripts
Welp, I tried. I have no clue how the camera works, but I assumed that they were just part of the Workspace, so I went with how I deal with parts. Guess I messed it up haha.
This is something that’d you need to send from the server to the client and not vice versa. If you’re sending it from the client, it can easily be intercepted by exploiters and they could break your game. I can assist you with using a remote event if you want. Also camera manipulation has to be done on the client.
Trying to find a solution to this warning, the thread I posted earlier has people saying the issue has persisted for many months, seems like it still wasn’t fixed.
Alright, so I’m not getting the warning and the only thing I did different in my script was set the subject before the camera type. Let me know if that fixes the issue for you!
the camera doesnt follow with the part, and its the player doesnt teleport to the game (or the spawn) anymore once the game starts (that has actually been happening since post 9)
and the warning appears right after the cutscene ends, but that warning doesnt break the camera
Consider tweening the camera’s CFrame between 2 parts instead of moving the part. This is what I did:
local camera = workspace.CurrentCamera
camera.CameraSubject = workspace.StartPos
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.StartPos.CFrame
wait(2)
TweenService:Create(workspace.CurrentCamera, TweenInfo.new(5), {CFrame = workspace.EndPos.CFrame}):Play()
Of course, mine was just for testing purposes. Gave me this result:
EDIT: Realized the gif doesn’t load because it’s too big, anyways here’s a compressed one:
Doing this, the orientation of the end part is also used because of how CFrames work.
Make sure the front face of the part is facing where you want the camera to be looking. I think roblox removed the functionality to see the face, for whatever reason, I use a plugin called Face Selector
This will also fix your other warning. As for the teleporting, are you sure the function being called (also change pairs to ipairs, which is what you use for list/array iteration)?
Can you just try this, run it, and then show me your console?
local playerModule = {}
local roundInfo = game:GetService("ReplicatedStorage").RoundInfo
function playerModule.teleportPlayer(playerName, teleportLocation)
print("Teleport player executued - Teleporting ".. playerName)
local gamePlayer = game.Players:FindFirstChild(playerName)
print(gamePlayer)
print(teleportLocation)
if gamePlayer then
local character = gamePlayer.Character or gamePlayer.CharacterAdded:Wait()
character.HumanoidRootPart.CFrame = teleportLocation.CFrame
end
end
function playerModule.teleportAllPlayers(teleportLocation)
print("Teleport all players executed")
for index, player in ipairs(roundInfo.Players:GetChildren()) do
print("Teleport all players - Teleporting ".. player.Name)
playerModule.teleportPlayer(player.Name, teleportLocation)
end
end
function playerModule.respawnAllPlayers()
for index, player in ipairs(roundInfo.Players:GetChildren()) do
local gamePlayer = game.Players:FindFirstChild(player.Name)
if gamePlayer then
gamePlayer:LoadCharacter()
end
end
end
game.Players.PlayerAdded:Connect(function(player)
local marker = Instance.new("StringValue", roundInfo.Players)
marker.Name = player.Name
end)
return playerModule
Afterwards when we find the issue you can remove the prints, I just don’t know a lot about your scripts, so this is an ok way to see if everything is executing, and if it isn’t where it stops.
Teleport all players executed prints, everything else doesnt, as its not used, i think its right here print("Teleport all players - Teleporting ".. player.Name)