mewishmeww

wormhole

Aug 5th, 2023 (edited)
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 28.98 KB | None | 0 0
  1. -- skip this its just the functions
  2.  
  3.  
  4.  
  5.  
  6.  
  7. function keyframeToTable(keyframeSequence)
  8.     local tabler = {}
  9.     local ch = keyframeSequence:GetChildren()
  10.     local function cLoop(key,t)
  11.         local cr = key:GetChildren()
  12.         for i=1, #cr do
  13.             if cr[i].ClassName == "Pose" then
  14.                 local current = cr[i]
  15.                 t[current.Name] = {["Name"]=current.Name,["EasingStyle"] = current.EasingStyle,["EasingDirection"] = current.EasingDirection,["CFrame"] = current.CFrame,["Weight"] = current.Weight}
  16.                 cLoop(current,t)
  17.             end
  18.         end
  19.     end
  20.     local function Sort(Value1, Value2)
  21.         return Value1["Time"] < Value2["Time"]
  22.     end
  23.     for i=1, #ch do
  24.         local k = ch[i]
  25.         table.insert(tabler,{["Time"] = k.Time,["Poses"]={}})
  26.         local tablee = tabler[#tabler]
  27.         cLoop(ch[i],tablee["Poses"])
  28.     end
  29.     table.sort(tabler, Sort)
  30.     return tabler
  31. end
  32.  
  33. local motors = {}
  34. local animRuns = {}
  35. local origMotors = {}
  36. local MotorPriority = {}
  37. local playingM6d = {}
  38.  
  39. function MainAnimation(char,Array,Speed,Name,Weld,Priority)
  40.     local currentPM = {}
  41.     local pri = {}
  42.     for i=1, #Array do
  43.         local poses = Array[i]["Poses"]
  44.         local Time = Array[i]["Time"]
  45.         if table.find(animRuns,Name) then
  46.             for z,v in pairs(poses) do
  47.                 if table.find(animRuns,Name) then
  48.                     local Pose = v
  49.                     local descChar = char:GetDescendants()
  50.                     local motor
  51.                     local found = false
  52.                     for p=1, #descChar do
  53.                         local dc = descChar[p]
  54.                         if not Weld then
  55.                             if dc.ClassName == "Motor6D" then
  56.                                 if dc.Part1.Name == Pose["Name"] then
  57.                                     motor = dc
  58.                                     found = true
  59.                                 end
  60.                             end
  61.                         else
  62.                             if dc.ClassName == "Weld" then
  63.                                 if dc.Part1.Name == Pose["Name"] then
  64.                                     motor = dc
  65.                                     found = true
  66.                                 end
  67.                             end
  68.                         end
  69.                     end
  70.                     if found and motor ~= nil then
  71.                         if not table.find(motors, motor) then
  72.                             table.insert(motors, motor)
  73.                             table.insert(origMotors, motor.C0)
  74.                         end
  75.                         if not table.find(pri,motor) then
  76.                             table.insert(MotorPriority,{["Motor"]=motor,["Priority"]=Priority})
  77.                             table.insert(playingM6d, {["Motor"]=motor,["AnimName"]=Name})
  78.                             table.insert(currentPM,MotorPriority[#MotorPriority])
  79.                             table.insert(currentPM,MotorPriority[#playingM6d])
  80.                             table.insert(pri,motor)
  81.                         end
  82.                         local style
  83.                         local direction
  84.                         if Pose["EasingStyle"] == Enum.PoseEasingStyle.Linear then
  85.                             style = Enum.EasingStyle.Linear
  86.                         elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Cubic then
  87.                             style = Enum.EasingStyle.Cubic
  88.                         elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Bounce then
  89.                             style = Enum.EasingStyle.Bounce
  90.                         elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Elastic then
  91.                             style = Enum.EasingStyle.Elastic
  92.                         elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Constant then
  93.                             style = true
  94.                         end
  95.                         if Pose["EasingDirection"] == Enum.PoseEasingDirection.In then
  96.                             direction = Enum.EasingDirection.In
  97.                         elseif Pose["EasingDirection"] == Enum.PoseEasingDirection.InOut then
  98.                             direction = Enum.EasingDirection.InOut
  99.                         elseif Pose["EasingDirection"] == Enum.PoseEasingDirection.Out then
  100.                             direction = Enum.EasingDirection.Out
  101.                         end
  102.                         local stopANIM = false
  103.                         for r=1, #MotorPriority do
  104.                             if not table.find(currentPM,MotorPriority[r]) then
  105.                                 if MotorPriority[r]["Motor"].Name == motor.Name then
  106.                                     if Priority<MotorPriority[r]["Priority"] then
  107.                                         stopANIM = true
  108.                                     end
  109.                                 end
  110.                             end
  111.                         end
  112.                         if not stopANIM then
  113.                             if origMotors[table.find(motors,motor)] ~= nil then
  114.                                 if i~=1 then
  115.                                     game:GetService("TweenService"):Create(motor,TweenInfo.new(((Time-Array[i-1]["Time"])/2)/Speed,style,direction),{C0 = origMotors[table.find(motors,motor)] * Pose["CFrame"]}):Play()
  116.                                 else
  117.                                     game:GetService("TweenService"):Create(motor,TweenInfo.new(0.01,style,direction),{C0 = origMotors[table.find(motors,motor)] * Pose["CFrame"]}):Play()
  118.                                 end
  119.                             end
  120.                         end
  121.                     end
  122.                 end
  123.             end
  124.         end
  125.         if table.find(animRuns,Name) then
  126.             if i~=1 then
  127.                 task.wait(((Time-Array[i-1]["Time"])/2)/Speed)
  128.             end
  129.         end
  130.     end
  131.     delay(0.1, function()
  132.         for i=1, #currentPM do
  133.             if table.find(MotorPriority,table.find(MotorPriority,currentPM[i])) then
  134.                 table.remove(MotorPriority,table.find(MotorPriority,currentPM[i]))
  135.             end
  136.             if table.find(playingM6d,table.find(playingM6d,currentPM[i])) then
  137.                 table.remove(playingM6d,table.find(playingM6d,currentPM[i]))
  138.             end
  139.         end
  140.     end)
  141. end
  142.  
  143. function Play(char,Array,Speed,Name,looped,usewelds,Priority)
  144.     if not looped then
  145.         delay(0, function()
  146.             if not table.find(animRuns,Name) then
  147.                 table.insert(animRuns,Name)
  148.             end
  149.             MainAnimation(char,Array,Speed,Name,usewelds,Priority)
  150.             local motorschar = char:GetDescendants()
  151.             for i=1, #motorschar do
  152.                 if not usewelds then
  153.                     if motorschar[i].ClassName == "Motor6D" then
  154.                         if table.find(motors,motorschar[i]) then
  155.                             local stop = false
  156.                             for r=1, #playingM6d do
  157.                                 local cur = playingM6d[r]
  158.                                 if cur["AnimName"] ~= Name then
  159.                                     if cur["Motor"] == motorschar[i] then
  160.                                         stop = true
  161.                                     end
  162.                                 end
  163.                             end
  164.                             if not stop then
  165.                                 local origc0 = origMotors[table.find(motors,motorschar[i])]
  166.                                 game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
  167.                             end
  168.                         end                    
  169.                     end
  170.                 else
  171.                     if motorschar[i].ClassName == "Weld" then
  172.                         if table.find(motors,motorschar[i]) then
  173.                             local stop = false
  174.                             for r=1, #playingM6d do
  175.                                 local cur = playingM6d[r]
  176.                                 if cur["AnimName"] ~= Name then
  177.                                     if cur["Motor"] == motorschar[i] then
  178.                                         stop = true
  179.                                     end
  180.                                 end
  181.                             end
  182.                             if not stop then
  183.                                 local origc0 = origMotors[table.find(motors,motorschar[i])]
  184.                                 game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
  185.                             end
  186.                         end
  187.                     end
  188.                 end
  189.             end
  190.         end)
  191.     else
  192.         delay(0, function()
  193.             if not table.find(animRuns,Name) then
  194.                 table.insert(animRuns,Name)
  195.             end
  196.             while wait() do
  197.                 if table.find(animRuns,Name) then
  198.                     MainAnimation(char,Array,Speed,Name,usewelds,Priority)
  199.                 else
  200.                     break
  201.                 end
  202.             end
  203.  
  204.             local motorschar = char:GetDescendants()
  205.             for i=1, #motorschar do
  206.                 if not usewelds then
  207.                     if motorschar[i].ClassName == "Motor6D" then
  208.                         if table.find(motors,motorschar[i]) then
  209.                             local stop = false
  210.                             for r=1, #playingM6d do
  211.                                 local cur = playingM6d[r]
  212.                                 if cur["AnimName"] ~= Name then
  213.                                     if cur["Motor"] == motorschar[i] then
  214.                                         stop = true
  215.                                     end
  216.                                 end
  217.                             end
  218.                             if not stop then
  219.                                 local origc0 = origMotors[table.find(motors,motorschar[i])]
  220.                                 game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
  221.                             end
  222.                         end                    
  223.                     end
  224.                 else
  225.                     if motorschar[i].ClassName == "Weld" then
  226.                         if table.find(motors,motorschar[i]) then
  227.                             local stop = false
  228.                             for r=1, #playingM6d do
  229.                                 local cur = playingM6d[r]
  230.                                 if cur["AnimName"] ~= Name then
  231.                                     if cur["Motor"] == motorschar[i] then
  232.                                         stop = true
  233.                                     end
  234.                                 end
  235.                             end
  236.                             if not stop then
  237.                                 local origc0 = origMotors[table.find(motors,motorschar[i])]
  238.                                 game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
  239.                             end
  240.                         end
  241.                     end
  242.                 end
  243.             end
  244.         end)
  245.     end
  246. end
  247.  
  248.  
  249.  
  250. function stop(AnimName)
  251.     if table.find(animRuns,AnimName) then
  252.         table.remove(animRuns,table.find(animRuns,AnimName))
  253.     end
  254. end
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263. -- end
  264.  
  265. local equip = {
  266.     [1] = {
  267.         ["Time"] = 0,
  268.         ["Poses"] = {
  269.             ["Right Arm"] = {
  270.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  271.                 ["Name"] = "Right Arm",
  272.                 ["Weight"] = 1,
  273.                 ["CFrame"] = CFrame.new(0, 0, 0, 0.985996008, -0.166768745, 0, 0.166768745, 0.985996008, 0, 0, 0, 1),
  274.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  275.             },
  276.             ["Torso"] = {
  277.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  278.                 ["Name"] = "Torso",
  279.                 ["Weight"] = 0,
  280.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  281.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  282.             },
  283.             ["HumanoidRootPart"] = {
  284.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  285.                 ["Name"] = "HumanoidRootPart",
  286.                 ["Weight"] = 0,
  287.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  288.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  289.             },
  290.             ["Left Arm"] = {
  291.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  292.                 ["Name"] = "Left Arm",
  293.                 ["Weight"] = 1,
  294.                 ["CFrame"] = CFrame.new(0, -1.53000021, -1.26999998, 0.484423518, 0.357382774, -0.798505664, -0.503654599, 0.860242486, 0.0794656128, 0.715308189, 0.363676071, 0.596719205),
  295.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  296.             }
  297.         }
  298.     },
  299.     [2] = {
  300.         ["Time"] = 0.10000000149011612,
  301.         ["Poses"] = {
  302.             ["Right Arm"] = {
  303.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  304.                 ["Name"] = "Right Arm",
  305.                 ["Weight"] = 1,
  306.                 ["CFrame"] = CFrame.new(0, 0, 0, 0.63876766, -0.769399703, 0, 0.769399703, 0.63876766, 0, 0, 0, 1),
  307.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  308.             },
  309.             ["Torso"] = {
  310.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  311.                 ["Name"] = "Torso",
  312.                 ["Weight"] = 0,
  313.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  314.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  315.             },
  316.             ["HumanoidRootPart"] = {
  317.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  318.                 ["Name"] = "HumanoidRootPart",
  319.                 ["Weight"] = 0,
  320.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  321.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  322.             },
  323.             ["Left Arm"] = {
  324.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  325.                 ["Name"] = "Left Arm",
  326.                 ["Weight"] = 1,
  327.                 ["CFrame"] = CFrame.new(-1.15999985, -1.0400002, -1.22000003, 0.352846742, 0.819194138, -0.45212844, -0.8859635, 0.447919965, 0.120151907, 0.300945073, 0.358174086, 0.883823216),
  328.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  329.             }
  330.         }
  331.     },
  332.     [3] = {
  333.         ["Time"] = 0.20000000298023224,
  334.         ["Poses"] = {
  335.             ["Right Arm"] = {
  336.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  337.                 ["Name"] = "Right Arm",
  338.                 ["Weight"] = 1,
  339.                 ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, 0.0680151582, -0.99768424, 0, 0.99768424, 0.0680151582, 0, 0, 0, 1),
  340.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  341.             },
  342.             ["Torso"] = {
  343.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  344.                 ["Name"] = "Torso",
  345.                 ["Weight"] = 0,
  346.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  347.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  348.             },
  349.             ["HumanoidRootPart"] = {
  350.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  351.                 ["Name"] = "HumanoidRootPart",
  352.                 ["Weight"] = 0,
  353.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  354.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  355.             },
  356.             ["Left Arm"] = {
  357.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  358.                 ["Name"] = "Left Arm",
  359.                 ["Weight"] = 1,
  360.                 ["CFrame"] = CFrame.new(-1.15999985, -0.0500001907, -1.57999992, -0.0513128564, 0.931526899, -0.360034049, -0.952259898, 0.0629989952, 0.298717409, 0.300945103, 0.358174056, 0.883823037),
  361.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  362.             }
  363.         }
  364.     },
  365.     [4] = {
  366.         ["Time"] = 0.30000001192092896,
  367.         ["Poses"] = {
  368.             ["Right Arm"] = {
  369.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  370.                 ["Name"] = "Right Arm",
  371.                 ["Weight"] = 1,
  372.                 ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, -0.0296663344, -0.99955982, 0, 0.99955982, -0.0296663344, 0, 0, 0, 1),
  373.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  374.             },
  375.             ["Torso"] = {
  376.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  377.                 ["Name"] = "Torso",
  378.                 ["Weight"] = 0,
  379.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  380.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  381.             },
  382.             ["HumanoidRootPart"] = {
  383.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  384.                 ["Name"] = "HumanoidRootPart",
  385.                 ["Weight"] = 0,
  386.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  387.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  388.             },
  389.             ["Left Arm"] = {
  390.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  391.                 ["Name"] = "Left Arm",
  392.                 ["Weight"] = 1,
  393.                 ["CFrame"] = CFrame.new(-1.15999985, -0.0500001907, -1.57999992, -0.223989442, 0.927409112, -0.299568295, -0.92696321, -0.10781344, 0.359326422, 0.300945103, 0.358174145, 0.883823156),
  394.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  395.             }
  396.         }
  397.     }
  398. }
  399. local idle = {
  400.     [1] = {
  401.         ["Time"] = 0,
  402.         ["Poses"] = {
  403.             ["Right Arm"] = {
  404.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  405.                 ["Name"] = "Right Arm",
  406.                 ["Weight"] = 1,
  407.                 ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, -0.0296663344, -0.99955982, 0, 0.99955982, -0.0296663344, 0, 0, 0, 1),
  408.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  409.             },
  410.             ["Torso"] = {
  411.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  412.                 ["Name"] = "Torso",
  413.                 ["Weight"] = 0,
  414.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  415.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  416.             },
  417.             ["HumanoidRootPart"] = {
  418.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  419.                 ["Name"] = "HumanoidRootPart",
  420.                 ["Weight"] = 0,
  421.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  422.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  423.             },
  424.             ["Left Arm"] = {
  425.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  426.                 ["Name"] = "Left Arm",
  427.                 ["Weight"] = 1,
  428.                 ["CFrame"] = CFrame.new(-1.15999985, -0.0500001907, -1.57999992, -0.223989442, 0.927409112, -0.299568295, -0.92696321, -0.10781344, 0.359326422, 0.300945103, 0.358174145, 0.883823156),
  429.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  430.             }
  431.         }
  432.     }
  433. }
  434. local shoot = {
  435.     [1] = {
  436.         ["Time"] = 0,
  437.         ["Poses"] = {
  438.             ["Right Arm"] = {
  439.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  440.                 ["Name"] = "Right Arm",
  441.                 ["Weight"] = 1,
  442.                 ["CFrame"] = CFrame.new(-0.210000038, -2.38418579e-07, 0, -0.140901208, -0.990023673, 0, 0.990023673, -0.140901208, 0, 0, 0, 1),
  443.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  444.             },
  445.             ["Torso"] = {
  446.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  447.                 ["Name"] = "Torso",
  448.                 ["Weight"] = 0,
  449.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  450.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  451.             },
  452.             ["HumanoidRootPart"] = {
  453.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  454.                 ["Name"] = "HumanoidRootPart",
  455.                 ["Weight"] = 0,
  456.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  457.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  458.             },
  459.             ["Left Arm"] = {
  460.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  461.                 ["Name"] = "Left Arm",
  462.                 ["Weight"] = 1,
  463.                 ["CFrame"] = CFrame.new(-1.15999985, -0.0500001907, -1.57999992, -0.454810679, 0.86850363, -0.197101071, -0.838200092, -0.342655599, 0.424273282, 0.300945103, 0.358174145, 0.883823156),
  464.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  465.             }
  466.         }
  467.     },
  468.     [2] = {
  469.         ["Time"] = 0.06666667014360428,
  470.         ["Poses"] = {
  471.             ["Right Arm"] = {
  472.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  473.                 ["Name"] = "Right Arm",
  474.                 ["Weight"] = 1,
  475.                 ["CFrame"] = CFrame.new(-0.455029488, 0.0231335163, 0, -0.267238319, -0.963630497, 0, 0.963630497, -0.267238319, 0, 0, 0, 1),
  476.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  477.             },
  478.             ["Torso"] = {
  479.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  480.                 ["Name"] = "Torso",
  481.                 ["Weight"] = 0,
  482.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  483.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  484.             },
  485.             ["HumanoidRootPart"] = {
  486.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  487.                 ["Name"] = "HumanoidRootPart",
  488.                 ["Weight"] = 0,
  489.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  490.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  491.             },
  492.             ["Left Arm"] = {
  493.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  494.                 ["Name"] = "Left Arm",
  495.                 ["Weight"] = 1,
  496.                 ["CFrame"] = CFrame.new(-0.909999847, 0.150000095, -1.57999992, -0.558979034, 0.817137301, -0.1408149, -0.772641122, -0.45166108, 0.446125269, 0.300945044, 0.358174086, 0.883823037),
  497.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  498.             }
  499.         }
  500.     },
  501.     [3] = {
  502.         ["Time"] = 0.13333334028720856,
  503.         ["Poses"] = {
  504.             ["Right Arm"] = {
  505.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  506.                 ["Name"] = "Right Arm",
  507.                 ["Weight"] = 1,
  508.                 ["CFrame"] = CFrame.new(-0.680433273, 0.278093338, 0.0187425613, -0.341928303, -0.939427495, -0.0236828625, 0.897503018, -0.33393079, 0.28805992, -0.278519869, 0.0772403851, 0.957319319),
  509.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  510.             },
  511.             ["Torso"] = {
  512.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  513.                 ["Name"] = "Torso",
  514.                 ["Weight"] = 0,
  515.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  516.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  517.             },
  518.             ["HumanoidRootPart"] = {
  519.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  520.                 ["Name"] = "HumanoidRootPart",
  521.                 ["Weight"] = 0,
  522.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  523.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  524.             },
  525.             ["Left Arm"] = {
  526.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  527.                 ["Name"] = "Left Arm",
  528.                 ["Weight"] = 1,
  529.                 ["CFrame"] = CFrame.new(-0.679999828, 0.390000343, -1.57999992, -0.624834001, 0.770477951, -0.126278162, -0.778065264, -0.601060987, 0.18259266, 0.0647827387, 0.212342769, 0.975045443),
  530.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  531.             }
  532.         }
  533.     },
  534.     [4] = {
  535.         ["Time"] = 0.20000000298023224,
  536.         ["Poses"] = {
  537.             ["Right Arm"] = {
  538.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  539.                 ["Name"] = "Right Arm",
  540.                 ["Weight"] = 1,
  541.                 ["CFrame"] = CFrame.new(-0.630433083, 0.198092937, 0.0187425613, -0.377671182, -0.925269604, -0.0352241695, 0.883057833, -0.371362597, 0.286877453, -0.278519928, 0.0772403926, 0.957319558),
  542.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  543.             },
  544.             ["Torso"] = {
  545.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  546.                 ["Name"] = "Torso",
  547.                 ["Weight"] = 0,
  548.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  549.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  550.             },
  551.             ["HumanoidRootPart"] = {
  552.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  553.                 ["Name"] = "HumanoidRootPart",
  554.                 ["Weight"] = 0,
  555.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  556.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  557.             },
  558.             ["Left Arm"] = {
  559.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  560.                 ["Name"] = "Left Arm",
  561.                 ["Weight"] = 1,
  562.                 ["CFrame"] = CFrame.new(-0.724413395, 0.364506721, -1.57999992, -0.655556023, 0.745735347, -0.118848644, -0.752362549, -0.631497622, 0.187513307, 0.0647826865, 0.212342754, 0.975045323),
  563.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  564.             }
  565.         }
  566.     },
  567.     [5] = {
  568.         ["Time"] = 0.30000001192092896,
  569.         ["Poses"] = {
  570.             ["Right Arm"] = {
  571.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  572.                 ["Name"] = "Right Arm",
  573.                 ["Weight"] = 1,
  574.                 ["CFrame"] = CFrame.new(-0.470433235, 0.198093176, 0.0187425613, -0.305634528, -0.952072024, -0.0121034235, 0.910502195, -0.295960933, 0.288778275, -0.278519869, 0.0772404298, 0.957319617),
  575.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  576.             },
  577.             ["Torso"] = {
  578.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  579.                 ["Name"] = "Torso",
  580.                 ["Weight"] = 0,
  581.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  582.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  583.             },
  584.             ["HumanoidRootPart"] = {
  585.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  586.                 ["Name"] = "HumanoidRootPart",
  587.                 ["Weight"] = 0,
  588.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  589.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  590.             },
  591.             ["Left Arm"] = {
  592.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  593.                 ["Name"] = "Left Arm",
  594.                 ["Weight"] = 1,
  595.                 ["CFrame"] = CFrame.new(-0.893395424, 0.255313873, -1.57999992, -0.593105853, 0.793978631, -0.133504167, -0.802513897, -0.569656491, 0.177377805, 0.0647826642, 0.212342784, 0.975045621),
  596.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  597.             }
  598.         }
  599.     },
  600.     [6] = {
  601.         ["Time"] = 0.36666667461395264,
  602.         ["Poses"] = {
  603.             ["Right Arm"] = {
  604.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  605.                 ["Name"] = "Right Arm",
  606.                 ["Weight"] = 1,
  607.                 ["CFrame"] = CFrame.new(-0.29043293, 0.198093414, 0.0187427998, -0.194035858, -0.980732262, 0.0226771981, 0.940625727, -0.179438263, 0.288140774, -0.278519809, 0.0772403926, 0.957319379),
  608.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  609.             },
  610.             ["Torso"] = {
  611.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  612.                 ["Name"] = "Torso",
  613.                 ["Weight"] = 0,
  614.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  615.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  616.             },
  617.             ["HumanoidRootPart"] = {
  618.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  619.                 ["Name"] = "HumanoidRootPart",
  620.                 ["Weight"] = 0,
  621.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  622.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  623.             },
  624.             ["Left Arm"] = {
  625.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  626.                 ["Name"] = "Left Arm",
  627.                 ["Weight"] = 1,
  628.                 ["CFrame"] = CFrame.new(-1.07039165, 0.0910534859, -1.57999992, -0.492398292, 0.856665075, -0.15384689, -0.867955744, -0.470144123, 0.160054296, 0.0647827089, 0.212342769, 0.975045681),
  629.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  630.             }
  631.         }
  632.     },
  633.     [7] = {
  634.         ["Time"] = 0.46666666865348816,
  635.         ["Poses"] = {
  636.             ["Right Arm"] = {
  637.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  638.                 ["Name"] = "Right Arm",
  639.                 ["Weight"] = 1,
  640.                 ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, -0.0296663344, -0.99955982, 0, 0.99955982, -0.0296663344, 0, 0, 0, 1),
  641.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  642.             },
  643.             ["Torso"] = {
  644.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  645.                 ["Name"] = "Torso",
  646.                 ["Weight"] = 0,
  647.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  648.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  649.             },
  650.             ["HumanoidRootPart"] = {
  651.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  652.                 ["Name"] = "HumanoidRootPart",
  653.                 ["Weight"] = 0,
  654.                 ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  655.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  656.             },
  657.             ["Left Arm"] = {
  658.                 ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
  659.                 ["Name"] = "Left Arm",
  660.                 ["Weight"] = 1,
  661.                 ["CFrame"] = CFrame.new(-1.15999985, -0.0500001907, -1.57999992, -0.223989442, 0.927409112, -0.299568295, -0.92696321, -0.10781344, 0.359326422, 0.300945103, 0.358174145, 0.883823156),
  662.                 ["EasingDirection"] = Enum.PoseEasingDirection.In
  663.             }
  664.         }
  665.     }
  666. }
  667.  
  668. local player = owner
  669. local character = player.Character or player.CharacterAdded:Wait()
  670.  
  671. local rem = Instance.new("RemoteEvent")
  672. rem.Name = "RMGTP"
  673. rem.Parent = character
  674. NLS('local p = game.Players.LocalPlayer local r = p.Character:FindFirstChild("RMGTP") local m = p:GetMouse()  m.Button1Down:Connect(function() print("SentToSever") r:FireServer(m.Hit) end)',character)
  675.  
  676. local tool = Instance.new("Tool")
  677. tool.Parent = player.Backpack
  678. tool.Grip = CFrame.new(0.300000012, -0.5, 0.649999976, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  679. tool.Name = "Wormhole Tunneler"
  680.  
  681. local Handle = Instance.new("Part")
  682. Handle.Parent = tool
  683. Handle.CanCollide = false
  684. Handle.Name = "Handle"
  685. Handle.Size = Vector3.new(1, 1.2, 2)
  686. local mesh = Instance.new("SpecialMesh")
  687. mesh.Parent = Handle
  688. mesh.MeshId = "http://www.roblox.com/asset/?id=34312118"
  689. mesh.TextureId = "http://www.roblox.com/asset/?id=34312142"
  690.  
  691. function motortoweld(m)
  692.     local weld = Instance.new("Weld")
  693.     weld.Part0 = m.Part0
  694.     weld.Part1 = m.Part1
  695.     weld.C0 = m.C0
  696.     weld.C1 = m.C1
  697.     weld.Name = m.Name.. " Weld"
  698.     return weld
  699. end
  700.  
  701. local char
  702. local motorleftarm
  703. local motorrightarm
  704. local motortorso
  705. local torsoW
  706. local leftArmW
  707. local RightArmW
  708.  
  709. tool.Equipped:Connect(function()
  710.     task.wait(0.15)
  711.     char = tool.Parent
  712.     leftArmW = motortoweld(char.Torso["Left Shoulder"])
  713.     RightArmW = motortoweld(char.Torso["Right Shoulder"])
  714.     torsoW = motortoweld(char.HumanoidRootPart.RootJoint)
  715.     motorleftarm = char.Torso["Left Shoulder"]
  716.     motorrightarm = char.Torso["Right Shoulder"]
  717.     motortorso = char.HumanoidRootPart.RootJoint
  718.     char.Torso["Left Shoulder"].Enabled = false
  719.     char.Torso["Right Shoulder"].Enabled = false
  720.     char.HumanoidRootPart.RootJoint.Enabled = false
  721.     leftArmW.Parent = char.Torso
  722.     RightArmW.Parent = char.Torso
  723.     torsoW.Parent = char.HumanoidRootPart
  724.     Play(char,equip,0.5,"equip",false,true,2)
  725.     Play(char,idle,0.5,"idle",true,true,1)
  726. end)
  727.  
  728. tool.Unequipped:Connect(function()
  729.     motorleftarm.Enabled = true
  730.     motorrightarm.Enabled = true
  731.     motortorso.Enabled = true
  732.     torsoW:Destroy()
  733.     leftArmW:Destroy()
  734.     RightArmW:Destroy()
  735.     stop("equip")
  736.     stop("idle")
  737.     stop("Shoot")
  738. end)
  739.  
  740. local canshoot = true
  741. local cooldown = 0.4
  742.  
  743. local portalHeight = 1
  744. local portalWidth = 10
  745.  
  746. local currentP1
  747. local currentP1C = {}
  748.  
  749. local cp1f
  750. local cp1 = true
  751.  
  752. function newportal(pos,norm)
  753.     local portal = Instance.new("Part")
  754.     portal.Shape = "Cylinder"
  755.     portal.Anchored = true
  756.     portal.Reflectance = 1
  757.     portal.Position = pos
  758.     portal.Size = Vector3.new(portalHeight, portalWidth, portalWidth)
  759.     portal.CFrame = CFrame.lookAt(pos,pos+norm) * CFrame.Angles(0,math.pi/2,0)
  760.     portal.Parent = workspace
  761.     if currentP1 ~= nil then
  762.         currentP1:Destroy()
  763.     end
  764.     if cp1f ~= nil then
  765.         cp1f:Disconnect()
  766.     end
  767.     local plrse=game.Players:GetChildren()
  768.     for i=1, #currentP1C do
  769.         currentP1C[i]["current"]:Destroy()
  770.     end
  771.     for i=1, #plrse do
  772.         currentP1C[plrse[i].Name]={}
  773.     end
  774.     local SurfaceGui = Instance.new("SurfaceGui")
  775.     local ViewportFrame = Instance.new("ViewportFrame")
  776.     local UICorner = Instance.new("UICorner")
  777.  
  778.     SurfaceGui.Parent = portal
  779.     SurfaceGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  780.     SurfaceGui.Face = Enum.NormalId.Right
  781.     SurfaceGui.LightInfluence = 1.000
  782.  
  783.     ViewportFrame.BackgroundTransparency = 1
  784.     ViewportFrame.BorderSizePixel = 0
  785.     ViewportFrame.Size = UDim2.new(1,0,1,0)
  786.     ViewportFrame.BorderSizePixel = 0
  787.     ViewportFrame.Parent = SurfaceGui
  788.     ViewportFrame.Name = "vp"
  789.     currentP1 = portal
  790.     UICorner.CornerRadius = UDim.new(999999999, 0)
  791.     UICorner.Parent = ViewportFrame
  792.    
  793.     cp1f = game:GetService("RunService").Heartbeat:Connect(function()
  794.         if cp1 then
  795.             for i=1, #plrse do
  796.                 local old
  797.                 if currentP1C[plrse[i].Name]["current"] ~= nil then
  798.                     old = currentP1C[plrse[i].Name]["current"]
  799.                 end
  800.                 currentP1C[plrse[i].Name]["current"] = SurfaceGui:Clone()
  801.                 local cl = currentP1C[plrse[i].Name]["current"]
  802.                 local players = game.Players:GetChildren()
  803.                 for r=1, #players do
  804.                     local c = players[i].Character
  805.                     if c ~= nil and cl:FindFirstChild("vp") then
  806.                         local charito = players[r].Character
  807.                         charito.Archivable = true
  808.                         charito:Clone().Parent = cl.vp
  809.                     end
  810.                 end
  811.                 if cl:FindFirstChild("vp") then
  812.                         local cam = Instance.new("Camera")
  813.                 cam.FieldOfView = 120
  814.                 cam.CFrame = portal.CFrame * CFrame.Angles(0,-math.pi/2,0)
  815.                 cl.vp.CurrentCamera = cam
  816.                 end
  817.                 delay(0.05, function()
  818.                     if currentP1C[plrse[i].Name]["current"] == cl then
  819.                         cl.Parent = player.PlayerGui
  820.                         cl.Adornee = portal
  821.                     end
  822.                     if old ~= nil then
  823.                         old:Destroy()
  824.                     end
  825.                 end)
  826.                 cp1 = false
  827.             end
  828.         end
  829.     end)
  830. end
  831.  
  832. rem.OnServerEvent:Connect(function(p,mh)
  833.     print("Got")
  834.     if canshoot then
  835.         canshoot = false
  836.         Play(char,shoot,0.5,"Shoot",false,true,2)
  837.         local raypa = RaycastParams.new()
  838.         raypa.FilterType = Enum.RaycastFilterType.Exclude
  839.         raypa.FilterDescendantsInstances = {char}
  840.         raypa.IgnoreWater = true
  841.         local ray = Ray.new(char.HumanoidRootPart.Position, (mh.p - char.HumanoidRootPart.Position).unit * 300)
  842.         local hit, position, normal = game.Workspace:FindPartOnRay(ray, tool.Parent)
  843.         local distance = (position - char.HumanoidRootPart.Position).magnitude
  844.         local part = Instance.new("Part")
  845.         part.Anchored = true
  846.         part.CanCollide = false
  847.         part.Transparency = 0
  848.         part.Color = Color3.new(0.0901961, 0.596078, 0.831373)
  849.         part.Material = Enum.Material.Neon
  850.         part.Size = Vector3.new(0.6, 0.6, distance)
  851.         part.CFrame = CFrame.new(position, char.HumanoidRootPart.Position) * CFrame.new(0, 0, -distance / 2)
  852.         part.Parent = workspace
  853.         game:GetService("TweenService"):Create(part,TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{Size = Vector3.new(0.001, 0.001, distance), Transparency = 1}):Play()
  854.         delay(0.5, function()
  855.             part:Destroy()
  856.         end)
  857.         if hit then
  858.             newportal(position,normal)
  859.         end
  860.         wait(cooldown)
  861.         canshoot = true
  862.     end
  863. end)
  864.  
  865. local portalUpd = 0.05
  866.  
  867. while task.wait() do
  868.     cp1 = true
  869.     task.wait(portalUpd)
  870. end
Advertisement
Add Comment
Please, Sign In to add comment