Values for locations

Hello,

I have this destination selector. It scrolls through a list of string values and sets the name of the value onto a display & is supposed to take the string value from them and put them into the main land position string value. This works fine when the player enters the value in manually through the keypad but not via this selector.

Here is some of the code for the selector;

function ControlFunctions.NextDestination()
	for i,v in pairs(Controls.Destination.Next:GetDescendants()) do
		if v:IsA("Sound") then
			v:Play()
		end
	end
	local folder = Destinations:GetChildren()
	Values.DestinationNumber.Value = Values.DestinationNumber.Value + 1
	if Values.DestinationNumber.Value > #folder then
		Values.DestinationNumber.Value = 1
	end
	Controls.Monitors.Monitor2.Screen.Screen.SurfaceGui.ImageLabel.Destination.Text = folder[Values.DestinationNumber.Value].Name
	Values.LandPosition.Value = folder[Values.DestinationNumber.Value]
end

And this is the error I am getting;

To clarify, both the land position and destination values are both string.

Any advice?

1 Like

Try

Values.LandPosition.Value = folder[Values.DestinationNumber.Value].Position

this error means that a value of a value instance (such as number, boolean, cframe) is being set to an instance rather than its respective value.

example:
intvalue.value = otherintvalue**.value**