I did it cheaply where I'm going to put a can't-collided brick at every spawn, each for a hat (similar to a VIP door but for hats). I was wondering what to base the hat texture on (I went by mesh). I was also wondering how I would change the two lines labeled --this is wrong, because I'm clueless about getChildren. I was also wondering about "for i=1 and #'s, but you don't have to answer that (haha). My Code:
permission = {""} -- not needed texture = "http://www.roblox.com/asset/?id=152725777" -- Basic Egg texture...? function checkOkToLetIn(name) for i = 1,#permission do if (string.upper(name) == string.upper(permission[i])) then return true end end return false end local Door = script.Parent function onTouched(hit) print("Part Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then getChildren() if human.Handle.Mesh.TextureId == texture instance.new(toolIwant)-- this is wrong Players.human.Backpack.-- this is wrong elseif (checkOkToLetIn(human.Parent.Name)) then end end end script.Parent.Touched:connect(onTouched)
Thank you very much for your time!
I am not sure whether the rest of your code will work but I changed the lines that you highlighted. You will also need to place the tool into Lighting.
permission = {""} -- not needed texture = "http://www.roblox.com/asset/?id=152725777" -- Basic Egg texture...? function checkOkToLetIn(name) for i = 1,#permission do if (string.upper(name) == string.upper(permission[i])) then return true end end return false end local Door = script.Parent function onTouched(hit) print("Part Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then getChildren() if human.Handle.Mesh.TextureId == texture game.Lighting["Tool You Want Here"]:Clone().Parent = game.Players:FindFirstChild(hit.Parent.Name) or nil elseif (checkOkToLetIn(human.Parent.Name)) then end end end script.Parent.Touched:connect(onTouched)