oatmeal2009

X-ray script

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