So I am currently making a plugin for my game, Mini Ware! And this error ( Mini Ware.lua:6: attempt to index nil with 'WaitForChild') keeps appearing when I press the Minigame Kit button, there is a model inside the script with the Minigame Kit but I just don't know what's causing it or how to fix it. Thanks.
local PluginToolbar = plugin:CreateToolbar("Mini Ware!")
local MenuButton = PluginToolbar:CreateButton("Menu", "Shows the menu for help and more.", "rbxassetid://4535959292")
local MingameKitButton = PluginToolbar:CreateButton("Minigame Kit", "Creates a minigame kit.", "rbxassetid://6620816")
MingameKitButton.Click:Connect(function()
local MinigameKit = script:WaitForChild("MinigameKit"):Clone()
MinigameKit.Parent = workspace
end)
-- Also, this is all I have done so far.

4 comments
Have you set the MinigameKit's parent to the script? If it isn't, that's why it's nil.
The MinigameKit's Parent is the script. @KingDamas
I would suggest making the plugin a model, and then do like script.Parent:WaitForChild("MinigameKit") although I do not know if it would fix anything
How am I meant to make it into a model?