Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is "userdata", and why all of "value holding" object all calling as an "userdata"?

Recently, I'm make some test script that I have to compare some values. But I forgot to add .Value at the end of IntValue(because I bad at scripting :c ), so the output show this error: Can't compare userdata with number

The error make me have a little confusing at first, because IntValue is a object that hold integer value, that mean the output should show like this: Can't compare an OBJECT with number

I really don't know anything about this, so hope you guys can help me.

Thank :D

2 comments

0

This simply happens because it does. IDK why, but it is not important. Its a problem, and you can fix it, you said you did.

0

I'm not the one fix it, I'm actually ask @Psudar on SH because I forgot to add .Value :/

1 answer

✓ Accepted answer

In Lua, there are 8 basic types: Nil, boolean, string, function, userdata, thread and table.

Roblox spins off Lua into their own version, Roblox Lua. The objects you see in the explorer are custom and not part of standard Lua, therefore it's a Userdata because they are added by Roblox.

Hope this answered your question!

2 comments

0

Thank for your answer, this help me a lot :D

0

No problemo, Block_manvn!

This discussion is preserved as it was. New answers, comments, and votes are closed.