Problems that cannot be undone after using scripts
Posted: Thu Sep 21, 2023 8:23 am
				
				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
			Code: Select all
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