Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I read Table Data?

Asked by 9 years ago
01local Name = "Coordinate Value Here"
02 
03-- Module Script
04local Module = {
05["11"] = Vector3.new(-23.9, 0.2, 12.4);
06["12"] = Vector3.new(0,0,0);
07}
08return Module
09 
10-- Main Script
11function GetLandingPos(Name)
12    for i,p in pairs(LocationTable) do
13        if (i == Name) then
14            return p
15        end
16    end
17    return nil
18end

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?

1Ext.Parent:MoveTo(TABLE VALUE HERE)

Like That

0
Where are you requiring the ModuleScript? LocationTable does not seem to be added as a variable in the main script. Spongocardo 1991 — 9y
0
It is required, I just haven't included it here TheTravelingHermit 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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

0
Sorry, That's not what Im asking TheTravelingHermit 0 — 9y
Ad

Answer this question