Yeah, I apologize for posting here so consistently. Still learning.
So basically, with my code it creates a button and when it clicks it it waits for the player to press a key and then changes the keybinds value with it. (I run that on the client just for testing)
Now so, when I run this. No errors. 1 and 2 prints. The print(a.ClassName, a.Name)
prints correctly but I don’t get that print('ok')
after the mousebutton1down event. The ClassName prints as a textbutton.
I’ve attempted to debug, changing things around for like 20 minutes but I can’t seem to get this to work.
Any help would be great, thanks.
p.s: (sorry)
Code:
for bindName, bindSettings in next, Keybind_Module do
print(1)
if bindSettings.Active == true and bindSettings.Editable == true then
print(2)
local a = TemplateBind:Clone()
a.Name = bindName
a.Text = bindName.." Bind: "..bindSettings.DefaultBind
a.Parent = keybindFrame.Binds
a.Visible = true
local conn
print(a.ClassName, a.Name)
a.MouseButton1Down:Connect(function()
print('ok')
a.Text = "Set new bind"
conn = UserInputService.InputBegan:Connect(function(object, g)
if not g then
local key = object.KeyCode
keybinds[a.Name].Value = key
a.Text = "Bind: "..key
conn:Disconnect()
end
end)
end)
end
end