Hello dear scriptinghelpers community. I am currently creating a Children counting Plugin for myself. (Maybe I'll upload it later). It's basiclly counting the children an Instance has. Here's a Code snippet: (Runs when the button in the toolbar is pressed)
local Selection = game:GetService("Selection")
local Selected = Selection:Get()
if(#Selected == 1)then
local Children = #Selected:GetChildren()
warn("[Doge's part counter] "..Selected:GetFullName().." has "..Children.." children.")
showResults(Selected:GetFullName(),Children)
elseif(#Selected == 0)then
GuiError("Nothing is selected.")
else
GuiError("More than 1 thing is selected.")
end
When I select a script and press the toolbar button there Comes an error:
11:19:22.560 - PartCounter.lua:198: attempt to call method 'GetChildren' (a nil value) 11:19:22.561 - Stack Begin 11:19:22.561 - Script 'PartCounter.lua', Line 198 11:19:22.561 - Stack End
Weird About this is that when I enter
game.ServerScriptService.PartCounter.PartCounter:GetChildren()
into the lua console in Studio it prints: (as exspected)
table: 0000022F3000A5A0
Is there any way to fix this?

3 comments
OMG I JUST NOTICED EXACTLY THAT.
Thanks anyways.
Don't forget to mark an answer as "accepted" or to modify your question title to include "[Solved]" so people know it's figured out