I am making a game with the players camera screen facing a certain area with a GUI, after the players hit play and vote for a map, and after the voted map is selected I want the players to be teleported to the destination and the camera goes back to their player AUTOMATICALLY. How can I return the camera to their avatar after they are teleported? What type of script should I put this in?
CODE: This is my intermission and voting code, I haven't teleported players yet, but I will after I return the camera to the player.
while true do
local timer = 15
repeat wait()
configs.Status.Value = "Intermission: ".. timer
wait(1)
timer = timer - 1
until timer == 0
configs.Status.Value = "..."
wait(1)
for i,v in pairs(maps:GetChildren()) do
local voteId = v:FindFirstChild("VoteId")
if voteId then
local intValue = Instance.new("IntValue",rStorage.Votes)
intValue.Name = v.Name
intValue.Value = 0
rEvents.CreateVote:FireAllClients(v.Name,voteId.Value)
end
end
timer = 10
repeat wait()
configs.Status.Value = "Map vote: ".. timer
wait(1)
timer = timer - 1
until timer == 0
configs.Status.Value = "..."
local map
local highest = 0
for i,v in pairs(rStorage.Votes:GetChildren()) do
if v:IsA("IntValue") then
local curMap = maps:FindFirstChild(v.Name)
if v.Value > highest and curMap then
map = curMap
end
end
end
if map then
configs.Status.Value = map.Name
else
map = maps:GetChildren()[1]
configs.Status.Value = map.Name
end
rEvents.RemoveAllVotes:FireAllClients()
for i,v in pairs(rStorage.Votes:GetChildren()) do
v:Destroy()
end
wait(3)
wait()
end
The camera will return to the player near the end, after the maps have been voted.

2 comments
Thanks!
No problem!