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

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

Asked by 4 years ago

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

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. haba_nero 386 — 4y
0
I'm not the one fix it, I'm actually ask @Psudar on SH because I forgot to add .Value :/ Block_manvn 395 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

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!

0
Thank for your answer, this help me a lot :D Block_manvn 395 — 4y
0
No problemo, Block_manvn! xXprohax0r1337Xx 74 — 4y
Ad

Answer this question