I have an issue which is its stuck i already try to debug and i found where it stucks.
local Cams = game.Workspace.Camera
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Cam = game.Workspace.CurrentCamera
local Recommend = game.ReplicatedStorage.Camera
script.Parent.MouseButton1Click:Connect(function()
Cam.CameraType = Enum.CameraType.Custom
Cam.CameraType = Enum.CameraType.Scriptable
for _, v in pairs(Cams:GetChildren()) do -- Its stuck here.
if v.Name == Recommend.Value then
Cam.CFrame = v.CFrame
end
end
end)
I think this will work, just index it and it will be fine.
local Cams = game.Workspace.Camera -- parts im assuming
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Cam = game.Workspace.CurrentCamera
local Recommend = game.ReplicatedStorage.Camera -- a value im assuming
script.Parent.MouseButton1Click:Connect(function()
Cam.CameraType = Enum.CameraType.Custom
Cam.CameraType = Enum.CameraType.Scriptable
for _, v in pairs(Cams:GetChildren()) do -- Its stuck here.
local index = v.Name[Recommended.Value]
Cam.CFrame = index.CFrame
end
end)