local hit = game.Workspace.TouchPart.Touched:connect(function(hit)
	
end)

local Item = hit.Pets:GetChildren():GetChildren().NumberChanged

function CreateEvent(text, color)
	game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
		Text = "[SERVER] "..text;
		Color = color;
		Font = Enum.Font.Fantasy;
		FontSize = Enum.FontSize.Size36;
	})
end
if hit then
CreateEvent(hit.Name.."Got a "..Item, Color3.new(126/255, 225/255, 240/255))
end

basically i want it to chat when somebody collects an item and local Item = hit.Pets:GetChildren():GetChildren().NumberChanged is supposed to see what changed for it to chat.

3 comments

0

You cannot use :GetChildren() on a Table, use :GetDescendants() instead of :GetChildren():GetChildren()

0

ok

0

use :GetDescendants() instead of :GetChildren() for tables.