Hello,
So I got it to work to where when you enter the part, a flashlight GUI and a SpotLight attached to the Torso appear. I’m struggling a bit though to deactivate the SpotLight after exiting and I’m not so sure how to go about it.
Footage:
Should be obvious what I’m going for.
How could I make the SpotLight disappear along with the GUI?
Setup:
The part being in Workspace

The code inside “Script”
local zone = script.Parent
local FlashlightOn = game.Workspace.FlashlightOn
local FlashlightOff = game.Workspace.FlashlightOff
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local FlashlightOn = ReplicatedStorage.FlashlightOn
local FlashlightOff = ReplicatedStorage.FlashlightOff
zone.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if not plr.PlayerGui:FindFirstChild("GUIClonedfromtouchblock") then
local clonedgui = script.Parent:FindFirstChildOfClass("ScreenGui"):Clone()
FlashlightOn:FireClient(plr)
clonedgui.Name = "GUIClonedfromtouchblock"
clonedgui.Parent = plr.PlayerGui
script.Parent.TouchEnded:Connect(function(hit2)
if hit == hit2 then
FlashlightOff:FireClient(plr)
game.Debris:AddItem(clonedgui,0)
end
end)
end
end
end
end)
The 2 RemoteEvents in ReplicatedStorage
![]()
The 2 LocalScripts inside StarterGui

The code inside of FlashlightOff
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Remote = ReplicatedStorage:WaitForChild("FlashlightOff")
local FlashlightOff = workspace.FlashlightOff
Remote.OnClientEvent:Connect(function()
FlashlightOff:Play()
end)
The code inside of FlashlightOn
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Remote = ReplicatedStorage:WaitForChild("FlashlightOn")
local FlashlightOn = workspace.FlashlightOn
Remote.OnClientEvent:Connect(function()
FlashlightOn:Play()
light = Instance.new('SpotLight')
light.Brightness = 5
light.Parent = game.Players.LocalPlayer.Character.Torso
end)
I’m not so sure how I’d disable
Instance.new('SpotLight')
with the LocalScript FlashlightOff to make it disappear along with the GUI. I’d appreciate some help!!