Voidage
(Voidage)
June 22, 2020, 11:52pm
#1
In my framework I have the ability to wrap custom objects to roblox instances. From this object they can access and set properties of the wrapped instance easily, through self. But, it doesn’t work with instance functions.
I need it to run the function as :, not . I get this error.
1 Like
sjr04
(uep)
June 23, 2020, 12:10am
#2
Side note: functions don’t have names
Remember that a:b()
is the same as a.b(a)
so you will want to do t.Wrapped[index](t.Wrapped)
to pass that self
argument.
By the way not x == y
is not the same as x ~= y
. Just use the latter anyways.
3 Likes
Voidage
(Voidage)
June 23, 2020, 12:20am
#3
Thanks, don’t know why I didn’t just think of passing the table itself through the function. Now I have the problem of what to return.
It’s still playing the sound, which is good, so I am not sure why this error is happening. I’m thinking it shouldn’t be nil because it JUST played it.
Edit: changing this
to this
gets rid of the error. But I don’t want to play sounds like this
1 Like
Voidage
(Voidage)
June 23, 2020, 4:21pm
#4
Bump, I haven’t got it fully working yet.
1 Like
Voidage
(Voidage)
June 24, 2020, 3:23pm
#5
Figured it out myself. Just return a function that calls the instance method.
2 Likes