Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RunService = game:GetService("RunService")
- local ConfigA = { PosX = 2.84210526315790, PosY = 0, PosZ = -5, RotX = 0, RotY = 0, RotZ = 0 }
- local ConfigB = { PosX = 3, PosY = 0, PosZ = -5, RotX = 0, RotY = 0, RotZ = 0 }
- local frames1 = {
- [1] = {time = 0.3, motors = {["Left Shoulder"] = {c0 = {-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0}, c1 = {0.655795693397522, 1.236661434173584, 0.09998662024736404, 0.26006144285202026, 0.07877108454704285, -0.9623748064041138, 0.599881649017334, 0.7678143978118896, 0.2249520868062973, 0.7566434144973755, -0.6358124613761902, 0.15242479741573334}}, ["Right Shoulder"] = {c0 = {1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0}, c1 = {-0.7065867185592651, 1.2888312339782715, 0.13503077626228333, 0.3181000351905823, -0.10894812643527985, 0.9417764544487, -0.6147013306617737, 0.732571542263031, 0.2923717200756073, -0.721772313117981, -0.6719141602516174, 0.1660606861114502}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.5000014901161194, -0.000004813075065612793, -1, 0, 0, 0, -0.3420201241970062, 0.9396926164627075, 0, 0.9396926164627075, 0.3420201241970062}}, ["Right Hip"] = {c0 = {1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0}, c1 = {0.49014925956726074, 0.9223679900169373, -0.06093467026948929, -0.12036892771720886, 0.15643447637557983, 0.9803262948989868, 0.019064567983150482, 0.9876883625984192, -0.15526843070983887, -0.9925461411476135, 0, -0.12186934053897858}}, ["Left Hip"] = {c0 = {-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0}, c1 = {-0.4863584637641907, 0.9229675531387329, -0.08682220429182053, -0.17151036858558655, -0.15643452107906342, -0.9726835489273071, -0.02716456912457943, 0.9876883625984192, -0.15405791997909546, 0.9848082065582275, 0, -0.17364822328090668}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}}}},
- [2] = {time = 0.2, motors = {["Left Shoulder"] = {c0 = {-1, 0.44550326466560364, 0.22699525952339172, 0, 0, -1, -0.45399051904678345, 0.8910065293312073, 0, 0.8910065293312073, 0.45399051904678345, 0}, c1 = {0.48642194271087646, 1.2428627014160156, 0.09998054057359695, 0.20678997039794922, 0.011550914496183395, -0.9783172011375427, 0.6202645301818848, 0.7717580795288086, 0.1402193307876587, 0.7566438317298889, -0.6358113288879395, 0.15242721140384674}}, ["Right Shoulder"] = {c0 = {1, 0.44550326466560364, 0.22699525952339172, 0, 0, 1, 0.45399051904678345, 0.8910065293312073, 0, -0.8910065293312073, 0.45399051904678345, 0}, c1 = {-0.5324568152427673, 1.2992743253707886, 0.13503044843673706, 0.26331499218940735, -0.04468588903546333, 0.9636750221252441, -0.6400874257087708, 0.7392786741256714, 0.20917807519435883, -0.7217732071876526, -0.6719134449958801, 0.16606111824512482}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.5000014901161194, -0.000004813075065612793, -1, 0, 0, 0, -0.3420201241970062, 0.9396926164627075, 0, 0.9396926164627075, 0.3420201241970062}}, ["Right Hip"] = {c0 = {1, -0.8910065293312073, -0.45399051904678345, 0, 0, 1, 0.45399051904678345, 0.8910065293312073, 0, -0.8910065293312073, 0.45399051904678345, 0}, c1 = {0.4901493489742279, 0.8825821876525879, -0.3938291668891907, -0.12036893516778946, 0.15643452107906342, 0.9803264141082764, -0.15357890725135803, 0.9726834297180176, -0.17407193779945374, -0.9807775020599365, -0.17151032388210297, -0.09305579215288162}}, ["Left Hip"] = {c0 = {-1, -0.8910065293312073, -0.45399051904678345, 0, 0, -1, -0.45399051904678345, 0.8910065293312073, 0, 0.8910065293312073, 0.45399051904678345, 0}, c1 = {-0.48635926842689514, 0.8541502952575684, -0.517183780670166, -0.17151080071926117, -0.15643472969532013, -0.9726852774620056, 0.19506560266017914, 0.9623740911483765, -0.1891719102859497, 0.9656800627708435, -0.22218163311481476, -0.134542316198349}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, 0, 0, -1, 0, 0, 0, -0.45399051904678345, 0.8910065293312073, 0, 0.8910065293312073, 0.45399051904678345}}}},
- [3] = {time = 0.2, motors = {["Left Shoulder"] = {c0 = {-1, 0.6349424123764038, -0.07691363990306854, 0, 0, -1, 0.13917309045791626, 0.9902680516242981, 0, 0.9902680516242981, -0.13917309045791626, 0}, c1 = {0.28365597128868103, 1.2285090684890747, -0.13755899667739868, 0.1316661238670349, -0.06048203632235527, -0.9894474744796753, 0.7255905270576477, 0.6859557032585144, 0.05462419614195824, 0.6754117012023926, -0.7251250147819519, 0.13420280814170837}}, ["Right Shoulder"] = {c0 = {1, 0.6349424123764038, -0.07691363990306854, 0, 0, 1, -0.13917309045791626, 0.9902680516242981, 0, -0.9902680516242981, -0.13917309045791626, 0}, c1 = {-0.32399752736091614, 1.2848305702209473, -0.21418389678001404, 0.18287906050682068, 0.019463321194052696, 0.9829429388046265, -0.7790804505348206, 0.6126933693885803, 0.1328180581331253, -0.5996569395065308, -0.7900812029838562, 0.12721234560012817}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.49999895691871643, -0.00000363960862159729, -1, 0, 0, 0, -0.4539903998374939, 0.8910064101219177, 0, 0.8910064101219177, 0.4539903998374939}}, ["Right Hip"] = {c0 = {1, -0.8504596948623657, 0.13184601068496704, 0, 0, 1, -0.13917309045791626, 0.9902680516242981, 0, -0.9902680516242981, -0.13917309045791626, 0}, c1 = {0.4901497960090637, 0.9082344770431519, 0.24053701758384705, -0.12036892771720886, 0.15643475949764252, 0.9803270101547241, 0.17409828305244446, 0.9755293726921082, -0.13429225981235504, -0.9773431420326233, 0.15450842678546906, -0.14465826749801636}}, ["Left Hip"] = {c0 = {-1, -0.8504596948623657, 0.13184601068496704, 0, 0, -1, 0.13917309045791626, 0.9902680516242981, 0, 0.9902680516242981, -0.13917309045791626, 0}, c1 = {-0.486367404460907, 0.9243426322937012, 0.04751630127429962, -0.1715117245912552, -0.15643465518951416, -0.9726874828338623, -0.09579496085643768, 0.9852827787399292, -0.14156949520111084, 0.9805183410644531, 0.06889694929122925, -0.18397250771522522}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, 0.13980840146541595, -0.007327089086174965, -1, 0, 0, 0, 0.13917309045791626, 0.9902680516242981, 0, 0.9902680516242981, -0.13917309045791626}}}},
- [4] = {time = 0.3, motors = {["Left Shoulder"] = {c0 = {-1, 0.6349424123764038, -0.07691363990306854, 0, 0, -1, 0.13917309045791626, 0.9902680516242981, 0, 0.9902680516242981, -0.13917309045791626, 0}, c1 = {0.18871334195137024, 1.2947314977645874, -0.09710556268692017, 0.09350723773241043, -0.09629596024751663, -0.9909518957138062, 0.7314850687980652, 0.6818540692329407, 0.002764919074252248, 0.6754084825515747, -0.7251200675964355, 0.1342003345489502}}, ["Right Shoulder"] = {c0 = {1, 0.6349424123764038, -0.07691363990306854, 0, 0, 1, -0.13917309045791626, 0.9902680516242981, 0, -0.9902680516242981, -0.13917309045791626, 0}, c1 = {-0.23134469985961914, 1.3561761379241943, -0.18189653754234314, 0.14185339212417603, 0.05150222033262253, 0.9885496497154236, -0.7875829935073853, 0.6108382940292358, 0.08119336515665054, -0.5996529459953308, -0.7900810837745667, 0.12721291184425354}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.49999895691871643, -0.00000363960862159729, -1, 0, 0, 0, -0.4539903998374939, 0.8910064101219177, 0, 0.8910064101219177, 0.4539903998374939}}, ["Right Hip"] = {c0 = {1, -0.8504596948623657, 0.13184601068496704, 0, 0, 1, -0.13917309045791626, 0.9902680516242981, 0, -0.9902680516242981, -0.13917309045791626, 0}, c1 = {0.4901497960090637, 0.9082344770431519, 0.24053701758384705, -0.12036892771720886, 0.15643475949764252, 0.9803270101547241, 0.17409828305244446, 0.9755293726921082, -0.13429225981235504, -0.9773431420326233, 0.15450842678546906, -0.14465826749801636}}, ["Left Hip"] = {c0 = {-1, -0.8504596948623657, 0.13184601068496704, 0, 0, -1, 0.13917309045791626, 0.9902680516242981, 0, 0.9902680516242981, -0.13917309045791626, 0}, c1 = {-0.486367404460907, 0.9243426322937012, 0.04751630127429962, -0.1715117245912552, -0.15643465518951416, -0.9726874828338623, -0.09579496085643768, 0.9852827787399292, -0.14156949520111084, 0.9805183410644531, 0.06889694929122925, -0.18397250771522522}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, 0.13980840146541595, -0.007327089086174965, -1, 0, 0, 0, 0.13917309045791626, 0.9902680516242981, 0, 0.9902680516242981, -0.13917309045791626}}}}
- }
- local frames2 = {
- [1] = {time = 0.3, motors = {["Left Shoulder"] = {c0 = {-1, 0.4806308448314667, 0.13781867921352386, 0, 0, -1, -0.27563735842704773, 0.9612616896629333, 0, 0.9612616896629333, 0.27563735842704773, 0}, c1 = {1.0957282781600952, 0.9174913763999939, 0.1494535207748413, 0.9642457962036133, -0.005751848220825195, -0.26494693756103516, 0.23482786118984222, -0.4448179006576538, 0.8642875552177429, -0.12282436341047287, -0.8956026434898376, -0.4275631010532379}}, ["Right Shoulder"] = {c0 = {1, 0.4806308448314667, 0.13781867921352386, 0, 0, 1, 0.27563735842704773, 0.9612616896629333, 0, -0.9612616896629333, 0.27563735842704773, 0}, c1 = {-0.9802425503730774, 0.9375810623168945, 0.19466930627822876, 0.9723168611526489, -0.005422200541943312, 0.23360519111156464, -0.2285979688167572, -0.2292010486125946, 0.9461557269096375, 0.04841237515211105, -0.9733641147613525, -0.22409555315971375}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.4999960958957672, -0.0000032633543014526367, -1, 0, 0, 0, 0.7547096014022827, 0.6560590267181396, 0, 0.6560590267181396, -0.7547096014022827}}, ["Right Hip"] = {c0 = {1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0}, c1 = {0.45788317918777466, 0.9217923879623413, 0.1850522756576538, -0.21385709941387177, 0.3400487005710602, 0.9157688021659851, -0.9695430397987366, -0.18845976889133453, -0.15643459558486938, 0.11939020454883575, -0.9213317632675171, 0.36999478936195374}}, ["Left Hip"] = {c0 = {-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0}, c1 = {-0.45171281695365906, 0.8875359892845154, 0.18248699605464935, -0.28749343752861023, -0.3180871605873108, -0.9034201502799988, 0.9493963718414307, -0.21918554604053497, -0.22495096921920776, -0.12646269798278809, -0.922376275062561, 0.36500537395477295}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -2.521235227584839, 0.7022572755813599, -1, 0, 0, 0, -0.9612616896629333, -0.27563735842704773, 0, -0.27563735842704773, 0.9612616896629333}}}},
- [2] = {time = 0.2, motors = {["Left Shoulder"] = {c0 = {-1, 0.4806308448314667, 0.13781867921352386, 0, 0, -1, -0.27563735842704773, 0.9612616896629333, 0, 0.9612616896629333, 0.27563735842704773, 0}, c1 = {1.0957282781600952, 0.9174913763999939, 0.1494535207748413, 0.9642457962036133, -0.005751848220825195, -0.26494693756103516, 0.23482786118984222, -0.4448179006576538, 0.8642875552177429, -0.12282436341047287, -0.8956026434898376, -0.4275631010532379}}, ["Right Shoulder"] = {c0 = {1, 0.4806308448314667, 0.13781867921352386, 0, 0, 1, 0.27563735842704773, 0.9612616896629333, 0, -0.9612616896629333, 0.27563735842704773, 0}, c1 = {-0.9802425503730774, 0.9375810623168945, 0.19466930627822876, 0.9723168611526489, -0.005422200541943312, 0.23360519111156464, -0.2285979688167572, -0.2292010486125946, 0.9461557269096375, 0.04841237515211105, -0.9733641147613525, -0.22409555315971375}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.4999960958957672, -0.0000032633543014526367, -1, 0, 0, 0, 0.7547096014022827, 0.6560590267181396, 0, 0.6560590267181396, -0.7547096014022827}}, ["Right Hip"] = {c0 = {1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0}, c1 = {0.45788317918777466, 0.9217923879623413, 0.1850522756576538, -0.21385709941387177, 0.3400487005710602, 0.9157688021659851, -0.9695430397987366, -0.18845976889133453, -0.15643459558486938, 0.11939020454883575, -0.9213317632675171, 0.36999478936195374}}, ["Left Hip"] = {c0 = {-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0}, c1 = {-0.45171281695365906, 0.8875359892845154, 0.18248699605464935, -0.28749343752861023, -0.3180871605873108, -0.9034201502799988, 0.9493963718414307, -0.21918554604053497, -0.22495096921920776, -0.12646269798278809, -0.922376275062561, 0.36500537395477295}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -2.521235227584839, 0.7022572755813599, -1, 0, 0, 0, -0.9612616896629333, -0.27563735842704773, 0, -0.27563735842704773, 0.9612616896629333}}}},
- [3] = {time = 0.2, motors = {["Left Shoulder"] = {c0 = {-1, 0.4806308448314667, 0.13781867921352386, 0, 0, -1, -0.27563735842704773, 0.9612616896629333, 0, 0.9612616896629333, 0.27563735842704773, 0}, c1 = {1.0957282781600952, 0.9174913763999939, 0.1494535207748413, 0.9642457962036133, -0.005751848220825195, -0.26494693756103516, 0.23482786118984222, -0.4448179006576538, 0.8642875552177429, -0.12282436341047287, -0.8956026434898376, -0.4275631010532379}}, ["Right Shoulder"] = {c0 = {1, 0.4806308448314667, 0.13781867921352386, 0, 0, 1, 0.27563735842704773, 0.9612616896629333, 0, -0.9612616896629333, 0.27563735842704773, 0}, c1 = {-0.9802425503730774, 0.9375810623168945, 0.19466930627822876, 0.9723168611526489, -0.005422200541943312, 0.23360519111156464, -0.2285979688167572, -0.2292010486125946, 0.9461557269096375, 0.04841237515211105, -0.9733641147613525, -0.22409555315971375}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.4999960958957672, -0.0000032633543014526367, -1, 0, 0, 0, 0.7547096014022827, 0.6560590267181396, 0, 0.6560590267181396, -0.7547096014022827}}, ["Right Hip"] = {c0 = {1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0}, c1 = {0.45788317918777466, 0.9217923879623413, 0.1850522756576538, -0.21385709941387177, 0.3400487005710602, 0.9157688021659851, -0.9695430397987366, -0.18845976889133453, -0.15643459558486938, 0.11939020454883575, -0.9213317632675171, 0.36999478936195374}}, ["Left Hip"] = {c0 = {-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0}, c1 = {-0.45171281695365906, 0.8875359892845154, 0.18248699605464935, -0.28749343752861023, -0.3180871605873108, -0.9034201502799988, 0.9493963718414307, -0.21918554604053497, -0.22495096921920776, -0.12646269798278809, -0.922376275062561, 0.36500537395477295}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -2.521235227584839, 0.7022572755813599, -1, 0, 0, 0, -0.9612616896629333, -0.27563735842704773, 0, -0.27563735842704773, 0.9612616896629333}}}},
- [4] = {time = 0.3, motors = {["Left Shoulder"] = {c0 = {-1, 0.3906268775463104, 0.13781677186489105, 0, 0, -1, -0.27563735842704773, 0.9612616896629333, 0, 0.9612616896629333, 0.27563735842704773, 0}, c1 = {1.095727801322937, 0.9074509739875793, 0.23388418555259705, 0.9642453789710999, -0.00575199956074357, -0.26494690775871277, 0.24093413352966309, -0.39733627438545227, 0.8854799866676331, -0.11036592721939087, -0.9176556468009949, -0.3817439079284668}}, ["Right Shoulder"] = {c0 = {1, 0.3906268775463104, 0.13781677186489105, 0, 0, 1, 0.27563735842704773, 0.9612616896629333, 0, -0.9612616896629333, 0.27563735842704773, 0}, c1 = {-0.9802501797676086, 0.9251397848129272, 0.2800779342651367, 0.9723208546638489, -0.005423196591436863, 0.23360580205917358, -0.23081935942173004, -0.17794367671012878, 0.9565915465354919, 0.036381855607032776, -0.9840265512466431, -0.17427027225494385}}, ["Neck"] = {c0 = {0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -0.5000002384185791, -0.0000012256205081939697, -1, 0, 0, 0, 0.8290374279022217, 0.5591928362846375, 0, 0.5591928362846375, -0.8290374279022217}}, ["Right Hip"] = {c0 = {1, -1.0900039672851562, -0.0000019073486328125, 0, 0, 1, 0, 1, 0, -1, 0, 0}, c1 = {0.4578838646411896, 0.9094749689102173, 0.28537240624427795, -0.21385644376277924, 0.340047687292099, 0.915769100189209, -0.974461555480957, -0.13998223841190338, -0.1755838394165039, 0.06848452240228653, -0.9299315214157104, 0.3612994849681854}}, ["Left Hip"] = {c0 = {-1, -1.0900039672851562, -0.0000019073486328125, 0, 0, -1, 0, 1, 0, 1, 0, 0}, c1 = {-0.4516972005367279, 0.8754047751426697, 0.28102439641952515, -0.28749313950538635, -0.3180871903896332, -0.9034199118614197, 0.9547113180160522, -0.17061130702495575, -0.24374516308307648, -0.07660181820392609, -0.9325830340385437, 0.352731853723526}}, ["RootJoint"] = {c0 = {0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0}, c1 = {0, -2.611239194869995, 0.702255368232727, -1, 0, 0, 0, -0.9612616896629333, -0.27563735842704773, 0, -0.27563735842704773, 0.9612616896629333}}}}
- }
- local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
- local RootPart = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
- local originalPos = RootPart.CFrame
- local originalWalkspeed = Humanoid.WalkSpeed
- local charDescendants = {}
- local isRunning = true
- local function createDummy(name)
- local dummy = Instance.new("Model")
- dummy.Name = name
- local function createPart(pName, size)
- local part = Instance.new("Part", dummy)
- part.Name, part.Size = pName, size
- part.TopSurface, part.BottomSurface = 0, 0
- part.CanCollide, part.Anchored = false, true
- return part
- end
- local head = createPart("Head", Vector3.new(1, 1, 1))
- local headMesh = Instance.new("SpecialMesh", head)
- headMesh.MeshType = Enum.MeshType.Head
- headMesh.Scale = Vector3.new(1.25, 1.25, 1.25)
- createPart("Torso", Vector3.new(2, 2, 1))
- createPart("Left Arm", Vector3.new(1, 2, 1))
- createPart("Right Arm", Vector3.new(1, 2, 1))
- createPart("Left Leg", Vector3.new(1, 2, 1))
- createPart("Right Leg", Vector3.new(1, 2, 1))
- local hrp = createPart("HumanoidRootPart", Vector3.new(2, 2, 1))
- hrp.Transparency = 1
- dummy.PrimaryPart = hrp
- Instance.new("Humanoid", dummy)
- return dummy
- end
- RootPart.CFrame = originalPos + Vector3.new(0, 100, 0)
- Humanoid.WalkSpeed = 0
- for _, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("Decal") then
- charDescendants[v] = v.Transparency
- v.Transparency = 1
- end
- end
- local anchorPlate = Instance.new("Part", workspace)
- anchorPlate.Size = Vector3.new(10, 1, 10)
- anchorPlate.CFrame = RootPart.CFrame - Vector3.new(0, 3, 0)
- anchorPlate.Anchored = true
- anchorPlate.Transparency = 1
- local CloneA = createDummy("LocalClone")
- CloneA.Parent = workspace
- pcall(function()
- CloneA.Humanoid:ApplyDescription(Humanoid:GetAppliedDescription())
- end)
- local CloneB
- local s, r = pcall(function() return game:GetObjects("rbxassetid://6822270792")[1] end)
- if s and r then
- CloneB = r
- for _, v in pairs(CloneB:GetDescendants()) do
- if v:IsA("BasePart") then v.Anchored = true v.CanCollide = false end
- end
- if not CloneB.PrimaryPart then CloneB.PrimaryPart = CloneB:FindFirstChild("HumanoidRootPart") or CloneB:FindFirstChild("Torso") end
- if not CloneB:FindFirstChildOfClass("Humanoid") then Instance.new("Humanoid", CloneB) end
- else
- CloneB = createDummy("StoreClone")
- end
- CloneB.Parent = workspace
- workspace.CurrentCamera.CameraSubject = CloneA:FindFirstChildOfClass("Humanoid")
- local function syncAccessories(cl)
- for _, acc in pairs(cl:GetChildren()) do
- if acc:IsA("Accessory") and acc:FindFirstChild("Handle") then
- local handle = acc.Handle
- local attachment = handle:FindFirstChildOfClass("Attachment")
- if attachment then
- local bodyPartName = attachment.Name:gsub("Attachment", "")
- if bodyPartName == "Hat" or bodyPartName == "FaceFront" or bodyPartName == "FaceCenter" or bodyPartName == "Hair" then bodyPartName = "Head" end
- if bodyPartName == "BodyFront" or bodyPartName == "BodyBack" then bodyPartName = "Torso" end
- local limb = cl:FindFirstChild(bodyPartName)
- if limb then
- local limbAttach = limb:FindFirstChild(attachment.Name)
- if limbAttach then
- handle.CFrame = limb.CFrame * limbAttach.CFrame * attachment.CFrame:Inverse()
- else
- handle.CFrame = limb.CFrame
- end
- end
- end
- end
- end
- end
- local function applySmooth(cl, dataFrames, rootBase, elapsed)
- local totalCycleTime = 0
- for i = 1, #dataFrames do totalCycleTime += dataFrames[i].time end
- local currentTime = elapsed % totalCycleTime
- local accumulated, curIdx, alpha = 0, 1, 0
- for i = 1, #dataFrames do
- local fTime = dataFrames[i].time
- if currentTime >= accumulated and currentTime < (accumulated + fTime) then
- curIdx = i
- alpha = (currentTime - accumulated) / fTime
- break
- end
- accumulated += fTime
- end
- local nextIdx = (curIdx % #dataFrames) + 1
- local f1, f2 = dataFrames[curIdx].motors, dataFrames[nextIdx].motors
- if not (f1 and f2 and f1["RootJoint"] and f2["RootJoint"]) then return end
- local torsoBaseStart = rootBase * CFrame.new(unpack(f1["RootJoint"].c0)) * CFrame.new(unpack(f1["RootJoint"].c1)):Inverse()
- local torsoBaseEnd = rootBase * CFrame.new(unpack(f2["RootJoint"].c0)) * CFrame.new(unpack(f2["RootJoint"].c1)):Inverse()
- local torsoCF = torsoBaseStart:Lerp(torsoBaseEnd, alpha)
- if cl:FindFirstChild("Torso") then cl.Torso.CFrame = torsoCF end
- for mot, pnm in pairs({["Neck"]="Head", ["Left Shoulder"]="Left Arm", ["Right Shoulder"]="Right Arm", ["Left Hip"]="Left Leg", ["Right Hip"]="Right Leg"}) do
- if f1[mot] and f2[mot] and cl:FindFirstChild(pnm) then
- cl[pnm].CFrame = (torsoBaseStart * CFrame.new(unpack(f1[mot].c0)) * CFrame.new(unpack(f1[mot].c1)):Inverse()):Lerp(
- torsoBaseEnd * CFrame.new(unpack(f2[mot].c0)) * CFrame.new(unpack(f2[mot].c1)):Inverse(), alpha
- )
- end
- end
- if cl.PrimaryPart then cl.PrimaryPart.CFrame = rootBase end
- syncAccessories(cl)
- end
- local sg = Instance.new("ScreenGui", game:GetService("CoreGui"))
- local main = Instance.new("Frame", sg)
- main.Size = UDim2.new(0, 150, 0, 60)
- main.Position = UDim2.new(0.5, -75, 0.8, 0)
- main.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- local st = Instance.new("TextButton", main)
- st.Size = UDim2.new(0.8, 0, 0.6, 0)
- st.Position = UDim2.new(0.1, 0, 0.2, 0)
- st.Text = "STOP"
- st.BackgroundColor3 = Color3.fromRGB(70, 30, 30)
- st.TextColor3 = Color3.new(1, 1, 1)
- st.MouseButton1Click:Connect(function()
- isRunning = false
- if CloneA then CloneA:Destroy() end
- if CloneB then CloneB:Destroy() end
- if anchorPlate then anchorPlate:Destroy() end
- RootPart.CFrame = originalPos
- Humanoid.WalkSpeed = originalWalkspeed
- for part, trans in pairs(charDescendants) do pcall(function() part.Transparency = trans end) end
- workspace.CurrentCamera.CameraSubject = Humanoid
- sg:Destroy()
- end)
- local elapsed = 0
- RunService.RenderStepped:Connect(function(dt)
- if not isRunning then return end
- elapsed += dt
- applySmooth(CloneA, frames1, originalPos * CFrame.new(ConfigA.PosX, ConfigA.PosY, ConfigA.PosZ) * CFrame.Angles(math.rad(ConfigA.RotX), math.rad(ConfigA.RotY), math.rad(ConfigA.RotZ)), elapsed)
- applySmooth(CloneB, frames2, originalPos * CFrame.new(ConfigB.PosX, ConfigB.PosY, ConfigB.PosZ) * CFrame.Angles(math.rad(ConfigB.RotX), math.rad(ConfigB.RotY), math.rad(ConfigB.RotZ)), elapsed)
- end)
Advertisement
Add Comment
Please, Sign In to add comment