Thanks for the help Xrystal, i appreciate it. I plugged your example into my code and managed to get it to run. This was exactly what I needed. However, I think I have a new problem now.
This works perfectly and outputs the expected index value in the Print function.
Lua Code:
mysecurebutton:SetAttribute(
"_onclick",
[[
local index = self:GetAttribute( "craftselectionindex" )
print(index)
]]
)
This does absoluty nothing at all, no error when ran but also seems to not even perform the function.
Lua Code:
mysecurebutton:SetAttribute(
"_onclick",
[[
local index = self:GetAttribute( "craftselectionindex" )
DoCraft(index)
]]
)
My guess is there is something more the defaut UI is doing for DoCraft() to function that I am not doing.
The Proteced message is not popping up but neither does it do anything.
Is there some type of logging mechanic I can use to see whats going on under the hood?