Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I read Table Data?

local Name = "Coordinate Value Here"

-- Module Script
local Module = {
["11"] = Vector3.new(-23.9, 0.2, 12.4);
["12"] = Vector3.new(0,0,0);
}
return Module

-- Main Script
function GetLandingPos(Name)
	for i,p in pairs(LocationTable) do
		if (i == Name) then
			return p
		end
	end
	return nil
end

I store various locations on the map in a Module Script, which contains a table of all the locations.

If a Table Matches a Coordinate Input Ex. Coordinate 11, Coordinate 12 ETC. It will travel to that Table items Vector3 Value.

How would I get the Vector3 to go into a MoveTo?

Ext.Parent:MoveTo(TABLE VALUE HERE)

Like That

2 comments

0

Where are you requiring the ModuleScript? LocationTable does not seem to be added as a variable in the main script.

0

It is required, I just haven't included it here

1 answer

you would do Ext.Parent:MoveTo(NameOfTableHere["11"])

1 comment

0

Sorry, That's not what Im asking

This discussion is preserved as it was. New answers, comments, and votes are closed.