Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- X-Ray Script avec activation/désactivation par la touche 'K'
- local transparencyLevel = 0.7 -- Niveau de transparence (0 = opaque, 1 = complètement transparent)
- local xRayEnabled = false
- -- Fonction pour définir la transparence des objets
- local function setTransparency(transparency)
- for _, object in ipairs(workspace:GetDescendants()) do
- if object:IsA("BasePart") then
- object.LocalTransparencyModifier = transparency
- end
- end
- end
- -- Fonction pour activer ou désactiver X-Ray
- local function toggleXRay()
- xRayEnabled = not xRayEnabled
- if xRayEnabled then
- setTransparency(transparencyLevel)
- print("X-Ray activé.")
- else
- setTransparency(0)
- print("X-Ray désactivé.")
- end
- end
- -- Détection des entrées clavier (Touche 'K')
- game:GetService("UserInputService").InputBegan:Connect(function(input, isProcessed)
- if not isProcessed and input.KeyCode == Enum.KeyCode.K then
- toggleXRay()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment