What does this code do?

local function XRay(castPoints, ignoreList)

2 ignoreList = ignoreList or {}

3 local parts = workspace.CurrentCamera:GetPartsObscuringTarget(castPoints, ignoreList)

4

5 for _, part in pairs(parts) do

6 part.LocalTransparencyModifier = 0.75

7 for _, child in pairs(part:GetChildren()) do

8 if child:IsA("Decal") or child:IsA("Texture") then

9 child.LocalTransparencyModifier = 0.75

10 end

11 end

12 end

13end

14

15XRay({ Vector3.new() }) ```

literally what it says
i havent scripted in awhile so forgive me for misinterpretations, but that gets parts from the camera and makes them slightly transparent, giving an ‘xray’ effect.

1 Like

when i tried it out though it didn’t work?

wait for someone else to reply, as i haven’t touched roblox studio in about 6mo and am can’t really debug

your function Xray takes 2 arguments ( line 1 ), and when you called it at line 15 you only gave an empty Vector3… so ofc it won’t work