So basically I am adding a function light on my helmet. To do so when pressed L key it fire an event which enable the light on the server (in theory)
local meep = game:GetService("ContextActionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
function keypress(actionName, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
if player.Character.Helmet:FindFirstChild("HelmetLight") then
game.ReplicatedStorage.HelmetLight:FireServer()
end
end
end
game.ContextActionService:BindAction("BoundAction", keypress, false, Enum.KeyCode.L)
This is the local script.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
game.ReplicatedStorage.HelmetLight.OnServerEvent:connect(function(player)
print(player.Name)
if player.Character.Helmet.HelmetLight.Light.L1.Enabled == false then
print("hello there")
player.Character.Helmet.HelmetLight.Light.L1.Enabled = true
player.Character.Helmet.HelmetLight.Light.L2.Enabled = true
else
print("bye there")
player.Character.Helmet.HelmetLight.Light.L1.Enabled = false
player.Character.Helmet.HelmetLight.Light.L2.Enabled = false
end
end)
This is the server script. Everything is fine until there. The server script give me this error:
23:32:13.589 - Helmet is not a valid member of Model 23:32:13.590 - Stack Begin 23:32:13.590 - Script 'ServerScriptService.HelmetLight', Line 9 23:32:13.590 - Stack End
No idea why it does that. Any idea?

5 comments
try adding a local HelmetLight = player.Character.HelmetFindFirstChild("HelmetLight") then doing
if HelmetLight then code endthe other theory could be because you cloned, or created the
HelmetLightinside a localscript to the player, which makes the HelmetLight local not serversidedFindFirstChild just stops the script since it ain't found.
I believe I found the problem, it didn't exist at all, the way I tested the script was throught the "test play". Once testing in a proper server, it worked. I think its because the "test play" server made my helmet local and not serversided like you said.
I diden't really look into the code at all but it could be because the helmet was added in a local script, probably not the case tho.