I am a novice and am currently learning to write scripts. After using my script, it cannot be undone. Please let me know where the problem lies. Thank you
ScriptName = "gg0"
gg0 = {}
function gg0:Name()
return "gg0"
end
function gg0:Version()
return "1.0"
end
function gg0:Description()
return "gg0"
end
function gg0:Creator()
return "xsz"
end
function gg0:UILabel()
return"gg0"
end
function gg0:Run(moho)
local layer = moho:LayerAsBone(moho.layer)
if layer == nil then
print("Please select at least one bone")
return
end
local frame = moho.frame + 1
local skel = moho:Skeleton()
for i=0, skel:CountBones()-1 do
local bone = skel:Bone(i)
if bone.fSelected then
oldangle=bone.fAnimAngle:GetValue(0)
bone.fAnimAngle:SetValue(frame, oldangle)
end
end
moho:SetCurFrame(frame)
end
I'm from China, currently using: Moho 15 » Win10 System
-- and for more examples of how to use it and how to mark a document as "dirty" (i.e. has been modified and needs to be saved) just follow any of the links referenced in the description of the function.