MaxproGlitcher

Code pas terminer X-Ray besoin correction a des problème pour désativer

Nov 19th, 2024
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. -- X-Ray Script avec activation/désactivation par la touche 'K'
  2. local transparencyLevel = 0.7 -- Niveau de transparence (0 = opaque, 1 = complètement transparent)
  3. local xRayEnabled = false
  4.  
  5. -- Fonction pour définir la transparence des objets
  6. local function setTransparency(transparency)
  7. for _, object in ipairs(workspace:GetDescendants()) do
  8. if object:IsA("BasePart") then
  9. object.LocalTransparencyModifier = transparency
  10. end
  11. end
  12. end
  13.  
  14. -- Fonction pour activer ou désactiver X-Ray
  15. local function toggleXRay()
  16. xRayEnabled = not xRayEnabled
  17. if xRayEnabled then
  18. setTransparency(transparencyLevel)
  19. print("X-Ray activé.")
  20. else
  21. setTransparency(0)
  22. print("X-Ray désactivé.")
  23. end
  24. end
  25.  
  26. -- Détection des entrées clavier (Touche 'K')
  27. game:GetService("UserInputService").InputBegan:Connect(function(input, isProcessed)
  28. if not isProcessed and input.KeyCode == Enum.KeyCode.K then
  29. toggleXRay()
  30. end
  31. end)
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment