I’m not sure what’s happening, the script in my plugin can’t seem to find it’s own child called Template.
Code:
local GroupService = game:GetService("GroupService")
local BanList = script.Parent
--Auto Resize
BanList.UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
BanList.CanvasSize = UDim2.new(0,0,0,BanList.UIListLayout.AbsoluteContentSize.Y)
end)
repeat wait(1) until game:GetService("ServerScriptService"):FindFirstChild("GroupBan")
local GroupBanFolder = game:GetService("ServerScriptService"):FindFirstChild("GroupBan")
function CloneTemplate(v)
local clonedtemplate = script:WaitForChild("Template"):Clone()
local groupInfo = GroupService:GetGroupInfoAsync(v.Value)
if not groupInfo then return end
clonedtemplate:WaitForChild("GrpName").Text = groupInfo.Name
clonedtemplate:WaitForChild("GroupLogo").Image = groupInfo.EmblemUrl
clonedtemplate:WaitForChild("ID").Text = v.Name
clonedtemplate.Name = v.Name
clonedtemplate.Parent = BanList
end
function UpdateBanList()
print("Updating BanList")
--Destroy
for i,v in pairs(script.Parent:GetChildren()) do
if v.Name ~= "Loader" or v.Name ~= "UIListLayout" then
v:Destroy()
end
end
wait()
for i,v in pairs(GroupBanFolder:GetChildren()) do
if v:IsA('NumberValue') then
CloneTemplate(v)
end
end
end
UpdateBanList()
GroupBanFolder.ChildAdded:Connect(UpdateBanList)
GroupBanFolder.ChildRemoved:Connect(UpdateBanList)
Error:
Explorer:
How do I fix this?
Thank you!