I’m making a keybinds module that will store the keybinds for each “action” and I am making a function that converts the enums to a string, for example:
Enum.UserInputType.MouseButton1
becomes a string "UserInputType/MouseButton1"
I am currently having trouble doing this, and It is giving me this error
string.format("%s/%s", tostr:12: attempt to index string with EnumItem
local Keybinds = {
current = {
["Dribble"] = {
["Dribble"] = Enum.UserInputType.MouseButton1
}
}
}
function Keybinds:convertToString()
for _, tool in Keybinds.current do
for key, enum in tool do
key[enum] = string.format("%s/%s", tostring(enum.EnumType), tostring(enum.Name))
end
end
end
(For anyone wondering, I am doing this so I can save it to a datastore, datastores do NOT save enums)