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!

6 comments
line 19 is underlined in studio and doesn't seem to work... is there anything to do to fix it? thank you VERY much! I really appreciate it!
What is the error? The code on line 19 looks perfect to me. Could you paste your line 19 for me?
My line 19 is the same (I copy and pasted) but in studio it's underlined in red and doesn't work. Is there another way? Thank you so much
Can you please paste your line 19 from studio?
game.Lighting["tool"]:Clone().Parent = game.Players:FindFirstChild(hit.Parent.Name) or nil
When I paste that line in studio, I get no errors.