DanOnScripts

X-RAY

Apr 24th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local function makeXRayPart(part)
  2. -- LocalTransparencyModifier will make parts see-through but only for the local
  3. -- client, and it won't replicate to the server
  4. part.LocalTransparencyModifier = .5
  5. end
  6.  
  7. -- This function uses recursion to search for parts in the game
  8. local function recurseForParts(object)
  9. -- Did we find a part that isn't
  10. if object:IsA("BasePart") then
  11. makeXRayPart(object)
  12. end
  13.  
  14. -- Stop if this object has a Humanoid - we don't want to see-through players!
  15. if object:FindFirstChildOfClass("Humanoid") then return end
  16.  
  17. -- Check the object's children for more parts
  18. for _, child in pairs(object:GetChildren()) do
  19. recurseForParts(child)
  20. end
  21. end
  22.  
  23. recurseForParts(workspace)
Add Comment
Please, Sign In to add comment