"X cannot be assigned to"

I’m making a plugin for a game I like so it’s easier to make maps for it. I’m trying to make it automatically scale and position the box at the start but it isn’t working. Here’s my code:

if Autoscale == true then
 if workspace:FindFirstChild("Start", true) then
		local StartScale = workspace:FindFirstChild("Start", true)
		
		--// X Axis \\--
	warn(StartScale.Position)	
	MapKit.MapStart.Position.X = StartScale.Position.X
	
 else
	warn("Didn't find part named 'Start' so there was no auto scaling.")
	end
end

Note: “StartScale” is the part in which the box is getting positioned and scaled to.

Note 2: The reason I’m not doing “MapKit.MapStart.Position = StartScale.Position” is because I don’t want the y axis to be messed with.

You need to assign to the Position property itself.

if Autoscale == true then
	if workspace:FindFirstChild("Start", true) then
		local StartScale = workspace:FindFirstChild("Start", true)

		--// X Axis \\--
		warn(StartScale.Position)	
		MapKit.MapStart.Position = Vector3.new(StartScale.Position.X, MapKit.MapStart.Position.Y, MapKit.MapStart.Position.Z)
	
	else
		warn("Didn't find part named 'Start' so there was no auto scaling.")
	end
end
2 Likes

Thank you for helping me figure this out! :slight_smile:

1 Like