I’m trying to add a feature to my game where my character can toggle their Flashlight On / Off, although I have no idea how to create this, the main issue I’m having is finding the flashlight, which is located inside of the Players head (It is added there when the Player joins) I’ve tried arguments such as:
local player = game.Players.LocalPlayer
Subject = game.Workspace:FindFirstChild(player:FindFirstChild(“Head”))
I also tried;
local player = game.Players.LocalPlayer
local Subject = game.Workspace:FindFirstChild(player:FindFirstChild(“Head”))
Although they don’t seem to work, I did get a few Output Errors although I was able to resolve these, although the script still did not work. There is one Output Error which I cannot seem to fix.
18:44:55.281 - Argument 1 missing or nil
This is referring to the following line;
Subject = game.Workspace:FindFirstChild(player:FindFirstChild(“Head”))
This is probably a very simple fix, and I’m probably making an error that could have been easily avoided. If anyone could help me resolve this issue that would be great. (The Script is a Local Script under StarterGui.)