So, i am doing an LocalScript to Manipulate Camera more “easy” (despite taking me more time to do the script)
So the fact Is that the script not working, here.
In “v:FindFirstChild(value)”, It prints nothing
Script:
wait(0.1)
local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local replicated = game:GetService("ReplicatedStorage")
local remote = replicated:WaitForChild("CameraPos")
local camera = workspace.CurrentCamera
local CameraPositions = workspace:WaitForChild("CameraPositions")
wait()
function cameraset(type, value)
if type == "part" then
for i, v in pairs(CameraPositions:GetChildren()) do
if v:FindFirstChild(value) then
print(value)
-- camera.CFrame = part.CFrame
end
end
else
print("No Part selected")
end
if type == "cframe" then
camera.CFrame = CFrame.new(value, value, value)
else
print("No Extra CFrame Selected")
end
end
wait(1)
cameraset("part", "Part1")
function cameraset(type, value)
print("1")
if type == "part" then
print("1")
for i, v in pairs(CameraPositions:GetChildren()) do
print("1")
if v:FindFirstChild(value) then
print(value)
-- camera.CFrame = part.CFrame
end
end
else
print("No Part selected")
end
if type == "cframe" then
camera.CFrame = CFrame.new(value, value, value)
else
print("No Extra CFrame Selected")
end
end
Where does the code stop? If it stops at the first 1, it’s because type is already used by lua, rename type to part or something else.
Ok, first part of the problem resolved, sorry for ruining the day but i noticed this, it says “nil”, any ideas why this occurs?, this happens when i try to Set The Part Named “Part1” CFrame to Camera CFrame
Side note: for the area which says if type == “cframe” it will error due to inputing a string into a Vector3.
Mark the response which resolved your OP.