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

How do I reference the descendants of a ModuleScript?

Asked by 8 years ago

Lets say My modulescript references the value of a StringValue object which is a descendant of the Modulescript.

When you try the obvious:

local module = {}
module.a = script.StringVal.Value
return module

a returns nil

So how do I keep a ancestry reference? Or is this not possible?

0
Please people I need an answer! randomsmileyface 375 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

Val is not a valid member of StringValue and that's what module.a is nil. Set module.a to script.StringValue.Value instead of Val and it will work as expected.

0
Sorry that was a quick typo I made when typing up the example. It still doesn't work randomsmileyface 375 — 8y
Ad

Answer this question