Head is not a valid member of Model

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to make this script work properly inside a LocalScript.
  2. What is the issue? Include screenshots / videos if possible!
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Script

local ArmoryDummy = game.Workspace:WaitForChild("ArmoryNPC")--NEED
local RaiderNPC = game.Workspace:WaitForChild("RaiderNPC")
local AssetFolder = game.ReplicatedStorage:WaitForChild("ArmoryAssets")
local Remote = game.ReplicatedStorage:WaitForChild("ArmoryAssets"):WaitForChild("Armory")
local maingroup = 5497028
local clientremote = ArmoryDummy:WaitForChild("RemoteEvent")
local plr = game:GetService("Players").LocalPlayer
repeat wait() until plr
local character = plr.Character or plr.CharacterAdded:wait()

clientremote.OnClientEvent:connect(function(msg)
			script.recived2:play()
			game.StarterGui:SetCore("SendNotification", {
			Title = "SERVER"; -- Required. Has to be a string!
			Text = msg; -- Required. Has to be a string!
			Icon = ""; -- Optional, defaults to "" (no icon)
			})
end)

repeat wait() until character:WaitForChild("Humanoid")
character.Humanoid.Died:connect(function()
	AssetFolder:FindFirstChild("LoseLife"):InvokeServer()
	if plr.Lives.Value == 0 then
			script.recived2:play()
			game.StarterGui:SetCore("SendNotification", {
			Title = "SERVER"; -- Required. Has to be a string!
			Text = 'You died 5 times..Lost loadout, retrieve them again at the armory'; -- Required. Has to be a string!
			Icon = ""; -- Optional, defaults to "" (no icon)
			})
	end
end)

ArmoryDummy.Head.ClickDetector.MouseClick:Connect(function(user)
	AssetFolder.GiveUI:InvokeServer("Give")
end)

RaiderNPC.Head.ClickDetector.MouseClick:connect(function(user)
	AssetFolder.GiveUI:InvokeServer("Give")
end)

You should do a ArmoryDummy:WaitForChild(“Head”) to wait for the head to load.

1 Like
ArmoryDummy:WaitForChild("Head").ClickDetector.MouseClick:Connect(function(user)

AssetFolder.GiveUI:InvokeServer("Give")

end)