Hey so i have been trying to make a plugin to make keybinds easier but then because this is my first time, I am confused by the error.
I am unable to locate anything inside my plugin script (or just my gui).
local toolbar = plugin:CreateToolbar("Keybind Creator")
local mainBtn = toolbar:CreateButton("Create Keybinds", "Create New Keybind", "rbxassetid://1317795086")
local opened = false
--local keybindUI = script.KeybindUI
local bin = script
local gui = bin.KeybindUI:Clone()
gui.Parent = game:GetService('CoreGui')
local function onBtnClicked()
if not opened then
opened = true
print('opened keybindcreator')
gui.Enabled = true
--insertUI = Instance.new("ScreenGui", game.CoreGui)
--insertFrame = Instance.new("Frame",insertUI)
--insertFrame.Size = UDim2.new(1, 0, 1, 0)
--insertFrame.BackgroundTransparency = 0
else if opened then
print('closed keybindcreator')
--insertUI:Destroy()
gui.Enabled = false
opened = false
end
end
end
mainBtn.Click:Connect(onBtnClicked)
It always comes up with:
11:18:47.564 - Keybind PluginTest.lua:3: attempt to index nil with ‘KeybindUI’
Just gonna point out a lot of things wrong with this script:
Why do you parent the gui to CoreGui?
For gui stuff, this should be created on the client. You don’t check gui stuff like button click functions on the server because then that just makes the “servers” job pointless. (clickdetector doesnt count unless you want it to do something client sided)
What is the “plugin,” a module?