So if there is a part called "DoorTrigger" in workspace and i want to find it by just typing "doortrigger" how would i do that?
local function findPart(fromParts, searchWord) for i, part in pairs(fromParts) do if part.Name:lower() == searchWord:lower() then return part end end end print(findPart(workspace:GetChildren(), "doortrigger"))
Now this is an example code that I just put together, but it should do the work of showing you how you can think.
To explain what part.Name:lower()
does it takes the string, which is the name of the Part, and makes all letters lowercase. "DoorTrigger":lower() = "doortrigger".
local game.Workspace.DoorTrigger = DoorTrigger
or if you do not want to do a varibile
game.Workspace.DoorTrigger
or
workspace.DoorTrigger
when you do game before workspace then workspace has a capitalized W so Workspace and when you do no game before it you do workspace all lowercase.