FindFirstDescendant not enabled?


so im not sure whats happening
heres the code in a normal script

script.Parent.Plr1.OnServerEvent:Connect(function(player)
	if game.Players:FindFirstDescendant("PLR1VAL") then
		script.Parent.Sound:Play()
	else
		local cheese = Instance.new("IntValue")
		cheese.Parent = player
		cheese.Value = 1
		cheese.Name = "PLR1VAL"
	end
	

end)
1 Like

as the above post suggests, use :FindFirstChild() with the 2nd argument as true.

for example:

FindFirstChild(“Something”,true)

2 Likes

For some reason, there have been lots of issues with FindFirstDescendant. I recommend using game.Players:FirstFirstChild("PLR1VAL", true), as setting the recursive paramater to true searches all descendants rather than only the immediate children.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.