|
| 30 Oct 2013 10:22 PM |
| Is it possible to check a model for a certain type of item, Like a hat? |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 30 Oct 2013 10:26 PM |
object:IsA("Hat") or object.ClassName == "Hat"
the latter is not suggested.
You can check different types of items based on their ClassName property.
|
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 10:26 PM |
Yes!
But if you were looking for code, I'm afraid you'll have to make an attempt at it on your own. Once you've done that, post your code and we can help you fix it! |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 10:47 PM |
| Arceus, Something tell's me you cant even script... |
|
|
| Report Abuse |
|
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 30 Oct 2013 10:51 PM |
Arceus: > 7000+ place visits > Places all non-free modeled (assuming) > Member of the wiki writing staff > Can't script ^ lol wat |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 10:53 PM |
| Jeez, I just read his post...Then the post above it. The guy above him told me how, he just told me to go away and come back when I have some knowledge but in a nicer way. |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 11:06 PM |
Firstly, I'd like to point out the facts. This forum is for posting broken scripts and getting help with the scripts you're making. You are asking us to write code for you, and that's not allowed.
Secondly, I'd like to inform you of what I'm trying to do, as a member of this forum. While I'm here primarily to fix scripts and explain concepts, I also like to try to push people into finding knowledge for themselves. It has been proven time and time again that people are far more likely to retain knowledge that they found themselves, as opposed to knowledge that was handed to them. I'm here as a script-fixer and an educator, and in this thread I was trying to push you to write what you think the code should look like so I, along with the other members of this forum, can help you learn the proper way to do it by explaining why your current conception of the solution is incorrect.
In layman's terms: I'm here trying to help you help yourself, because you won't learn a thing if you don't understand how the scripts work.
And who knows, maybe you will learn it by someone handing you the answer, but that's not my style and I won't change the way I do things in order to help the few people that can learn simply by looking at the wiki's tutorials. |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 11:12 PM |
What I said: "Is it possible to check a model for a certain type of item, Like a hat?"
What you said: "This forum is for posting broken scripts and getting help with the scripts you're making. You are asking us to write code for you, and that's not allowed."
I didn't ask for anyone to write a code for me, Now did I?
"While I'm here primarily to fix scripts and explain concepts"
You also didn't explain any concepts to me, Should I say more? |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 11:23 PM |
Perhaps I wasn't clear. I'm here primarily to fix broken pieces of code and to explain scripting-related concepts. Checking a model for a certain type of hat is not a concept, it is a procedure. The differences are many and large.
I see that you aren't asking specifically for code, however I don't see a very clear way to answer your question without using code. Perhaps I could write out an ordered list of things the code should do in order to check for the hat?
1) Define a way to compare any given Hat to the hat you're looking for. 2) Find the model you're going to be searching through (henceforth referred to as 'model') 3) Get all of the descendants of 'model' (a table of descendants, ordered in an intuitive and easily discernible manner should be referred to as 'descendants' in the following steps) 4) Perform a recursive conditional check through the 'descendants' table, once for each descendant, to determine if that descendant is a member of the superclass "Accoutrement". If so, compare the qualities of the descendant to those of the definition that was defined in step 1. If an acceptable number of comparisons can be found between the two, you have your hat. |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 11:27 PM |
| You'd think that a Roblox Wiki Staff writer would direct me to a wiki. Besides, telling me to figure it out, which is essentially what you did, even a starting place would have been helpful. |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 11:31 PM |
We don't have wiki pages on very many specific subjects. The goal of the wiki is to provide a resource for people to learn, not explain detailed topics. If it were within the scope of the wiki, you'd be safe in betting that I would be making a tutorial for every other thread posted on this forum, even this one, but it's simply not what the wiki is for.
All insults aside, I explained to you step-by-step what your code should be doing. If you're looking for code, you should say so now so I can go make better use of my time in threads that will appreciate it. |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 11:33 PM |
I don't think you understand, telling me the below got me no where... Explain to me how you thought that was going to help at all?
But if you were looking for code, I'm afraid you'll have to make an attempt at it on your own. Once you've done that, post your code and we can help you fix it!
|
|
|
| Report Abuse |
|
|
Zachiah
|
  |
| Joined: 27 Oct 2013 |
| Total Posts: 1401 |
|
|
| 30 Oct 2013 11:36 PM |
| Haha, are you trying reverse psychology on Arceus? |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 11:49 PM |
"I don't think you understand, telling me the below got me no where"
I understand enough to know why it got you nowhere. You learned nothing because you didn't post any code for me to fix. I've been through this enough times to know how most people learn to script. Do you think any one of the most intelligent scripters got there by being handed the solutions? They had to figure out why things weren't working and they had to understand what was wrong with their code. The understanding is the key part that made them great scripters. You're trying to skip the understanding and get right to the meat of it. You're cheating yourself out of a learning experience in the interest of instant gratification, and I refuse to be a part of that. |
|
|
| Report Abuse |
|
|