Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Died is not a valid member of Model?

local Humanoid = script.Parent.Raider1 -- Or Zombie Or Whatever 
function PwntX_X() 
local tag = Humanoid:findFirstChild("creator") 
	if tag ~= nil then 
		if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
			if Leaderstats ~= nil then 
Leaderstats.KOs.Value = Leaderstats.KOs.Value + 1 
wait(0.1)
script:remove()
			end 
		end 
	end 
end 
Humanoid.Died:Connect(PwntX_X) 

I don't know what to do, the error says Died is not a valid member of Model

3 comments

2

It means that Humanoid is not a "Humanoid."

0

^

0

^

1 answer

local Humanoid = script.Parent.Raider1.Humanoid
function PwntX_X() 
local tag = Humanoid.Parent:findFirstChild("creator")
	if tag ~= nil then 
		if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
			if Leaderstats ~= nil then 
Leaderstats.KOs.Value = Leaderstats.KOs.Value + 1 
wait(0.1)
script:remove()
			end 
		end 
	end 
end 
Humanoid.Died:Connect(PwntX_X) 

1 comment

0

please edit your question instead of posting an answer, there is an edit button somewhere

This discussion is preserved as it was. New answers, comments, and votes are closed.