#Calling module base on a variable

1 messages · Page 1 of 1 (latest)

vestal bobcat
#

Heres the module code:

local TeleportIDs = {}
local Chapter1 = "74693798568641"
local Chapter2 = "ID"
local Chapter4 = "ID"
local Chapter3 = "ID"
local Chapter5 = "ID"
local Chapter6 = "ID"
local Chapter7 = "ID"
local Chapter8 = "ID"
return TeleportIDs

Heres the script code:

local PlaceIDs = require(game.ServerScriptService.ModuleScript)
local CT = Chapter1
local teleportchapter = PlaceIDs.CT

Currently when I run the script it outputs nil,ho wo dI get it to work?

worn pasture
#

local teleportchapter = PlaceIDs.Chapter1

vestal bobcat
worn pasture
#

then probably check if chosen by a player and if chosen then do whatever you want with it

meager kestrel
hasty forge
#

You gotta do TeleportIDs.TableName ={ chapters }

#

In the module

vestal bobcat
hasty forge
#

Well duh

#

You gotta path it

#

PlaceIDs.TableName.Chapter1

#

Is the path

vestal bobcat
#

I had PlaceIDs.CT

#

It should have been PlaceIDs[CT]