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 8 years ago
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

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

1 answer

Log in to vote
0
Answered by 8 years ago

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

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

Answer this question