Me and my friend on Roblox were playing one of those old Roblox simulator games, and we came to the topic of removing hats if they were made after 2007. I suggested finding the asset ID of the last hat made in '07, and if the number is greater than that it would remove the hat.
The thing is, I don't know how you would format an asset ID to put in a script, if it is even possible (I've seen it done before, but...)
I don't know if you would put something like http://www.roblox.com/asset/?id= or something before it, or just put the number...
Thanks in advance.
game.Players.PlayerAdded:connect(function(playerAdded)
player.CharacterAdded:connect(function(characterAdded)
if characterAdded.Accessory. --i think i'm on the right track here but idk
then character.Accessory.Handle:Destroy()
end
end)
end)
Edit: Here's what I think the script would look like. Yeah, all I've gotten to is the part where the player joins the game, and then the end part where the handle is destroyed if the assetID is above a certain number.
This probably will make all you experienced Lua users cringe, but this is what I have. Correct me if need be.

15 comments
THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU SO MUUUCH
You're welcome.
It doesn't seem to remove the hats though. ._. I think I'm on the right track though. My friend was pretty impressed xD
Really? I tested the script myself and it's working perfectly fine for me.
Are you using the second block of code in my answer or the first one? The first one was just an example while the second one added on to it and was the final script.
I'm using the second one. IDK why it's not working for me and working for you, as it's the exact same script. Studio hates me ;-;
https://puu.sh/syXDs/711fd7a10d.gif here's a gif that paints a clearer picture of my problem
In your script shown in the gif, you're missing the last two lines of code that I provided for you. There should be an "end) end)" at the end of your script just like in my answer.
Those two are in there... odd. https://puu.sh/sz141/b0a9349e0e.png
All I can say is: Make sure you copied my code exactly how it is in the answer. Also, make sure that the code is in a normal script (not a LocalScript or something) inside of Workspace.
It's working perfectly fine for me. Look here (don't be confused by the invisible head, that's just a type of Head I'm wearing): https://gyazo.com/c5b35eaa9f1ad347024dc8738dfc1c51
i finally got it to work and i know you're gonna be mad when i found out how simple my problem was
Why? What was the problem?
I had set it to disabled in the beginning so it wouldn't mess up any other scripts running in my game... Well, I forgot to enable it again. But it works now, and my friend and I are using it in a 2007 Crossroads simulator.
Oh. Such a simple mistake. Anyways, I'm glad it's finally working.