What is the issue: I am trying to get a string value from a folder and then changing the text of a text label. The issue however the output says something like: invalid argument #3 (string expected, got nil)
More info:
Code:
local tweenservice = game:GetService(“TweenService”)
local section1 = 1
local section2 = 1
local state = 1
local function changecameratype(scriptable,custom)
if scriptable == true then
repeat
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
until game.Workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
elseif custom == true then
repeat
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
until game.Workspace.CurrentCamera.CameraType == Enum.CameraType.Custom
end
end
local function moveobject(TIME,OBJECT,OBJECTTO,STYLE,DIRECTION)
tweenservice:Create(OBJECT,TweenInfo.new(TIME,STYLE,DIRECTION),{CFrame = OBJECTTO.CFrame})
end
local function NEXT()
if state == 1 then
changecameratype(true,false)
game.Workspace.CurrentCamera.CFrame = game.Workspace.Selection:FindFirstChild(section1).Camera.CFrame
script.Parent.TopName.Text = game.Workspace.Selection:FindFirstChild(section1).PackName.Value
elseif state == 2 then
changecameratype(true,false)
game.Workspace.CurrentCamera.CFrame = game.Workspace.Selection:FindFirstChild(section1):FindFirstChild(section2).Camera.CFrame
script.Parent.TopName.Text = game.Workspace.Selection:FindFirstChild(section1).PackName.Value
end
end
local function PRE()
end
local function SELECT()
if state == 1 then
state = 2
changecameratype(true,false)
moveobject(2,game.Workspace.CurrentCamera,game.Workspace.Selection:FindFirstChild(section1)[“1”].Camera,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
game.Workspace.CurrentCamera.CFrame = game.Workspace.Selection:FindFirstChild(section1)[“1”].Camera.CFrame
print(section2)
print(section1)
script.Parent.TopName.Text = game.Workspace.Selection[section1][section2].Name.Value
end
end
script.Parent.Frame.Next.MouseButton1Click:Connect(NEXT)
script.Parent.Frame.Pre.MouseButton1Click:Connect(PRE)
script.Parent.Frame.Select.MouseButton1Click:Connect(SELECT)
Screen: