Skip to content

Commit

Permalink
I think I was mistaken about the second case
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Dec 20, 2024
1 parent 984e87e commit 72ed253
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/RobloxInternal/tryGetService.luau
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,9 @@ local function tryGetService(serviceName: string): Instance?

if service and canAccess(service) then
return service
else
return nil
end

-- Some services cannot be retrieved by GetService but still exist in the DM
-- and can be retrieved by name.
pcall(function()
service = game:FindFirstChild(serviceName)
end)

if service and canAccess(service) then
return service
end

return nil
end

return tryGetService

0 comments on commit 72ed253

Please sign in to comment.