RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create night vision goggle script"
-- local script local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local head = character:WaitForChild("Head") local visionPart = Instance.new("Part") local function createNightVision() visionPart.Name = "NightVision" visionPart.Size = Vector3.new(1, 1, 1) visionPart.Transparency = 0.5 visionPart.BrickColor = BrickColor.new("Bright green") visionPart.Material = Enum.Material.Neon visionPart.Parent = head visionPart.CFrame = head.CFrame * CFrame.new(0, 0, -2.5) visionPart.Anchored = true visionPart.CanCollide = false end local function removeNightVision() if head:FindFirstChild("NightVision") then head.NightVision:Destroy() end end local function toggleNightVision() if head:FindFirstChild("NightVision") then removeNightVision() else createNightVision() end end local function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.N and not gameProcessedEvent then toggleNightVision() end end game:GetService("UserInputService").InputBegan:Connect(onKeyPress)