Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can someone help me fix my game chats when player collects a crate script? [closed]

Asked by 5 years ago
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.

0
You cannot use :GetChildren() on a Table, use :GetDescendants() instead of :GetChildren():GetChildren() SerpentineKing 3885 — 5y
0
ok magentacrasyguy -7 — 5y
0
use :GetDescendants() instead of :GetChildren() for tables. aandmprogameing 52 — 5y

Closed as Non-Descriptive by EpicMetatableMoment, SaltyPotter, GoldAngelInDisguise, popeeyy, and SerpentineKing

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?