Simple flashlight script
Key RequiredUniversal

Simple flashlight script

Universal Scripthawk2hawk2 9.4K views 95 executesUpdated Apr 29, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•36 lines (929 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera

local flashlight = Instance.new("Part")
flashlight.Name = "Flashlight"
flashlight.Anchored = true
flashlight.CanCollide = false
flashlight.Size = Vector3.new(0.2, 0.2, 0.2)
flashlight.Transparency = 1
flashlight.Parent = workspace

local light = Instance.new("SpotLight")
light.Parent = flashlight
light.Brightness = 2
light.Range = 30
light.Angle = 80
light.Enabled = false

-- Toggle with F
local flashlightOn = false
player:GetMouse().KeyDown:Connect(function(key)
	if key:lower() == "f" then
		flashlightOn = not flashlightOn
		light.Enabled = flashlightOn
	end
end)


RunService.RenderStepped:Connect(function()
	if flashlightOn then
		local camCF = camera.CFrame
		flashlight.CFrame = CFrame.new(camCF.Position, camCF.Position + camCF.LookVector)
	end
end)

Features & Information

Press f to toggle Use when you are playing a scary game or smh and there is no flahgint

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts