Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- skip this its just the functions
- function keyframeToTable(keyframeSequence)
- local tabler = {}
- local ch = keyframeSequence:GetChildren()
- local function cLoop(key,t)
- local cr = key:GetChildren()
- for i=1, #cr do
- if cr[i].ClassName == "Pose" then
- local current = cr[i]
- t[current.Name] = {["Name"]=current.Name,["EasingStyle"] = current.EasingStyle,["EasingDirection"] = current.EasingDirection,["CFrame"] = current.CFrame,["Weight"] = current.Weight}
- cLoop(current,t)
- end
- end
- end
- local function Sort(Value1, Value2)
- return Value1["Time"] < Value2["Time"]
- end
- for i=1, #ch do
- local k = ch[i]
- table.insert(tabler,{["Time"] = k.Time,["Poses"]={}})
- local tablee = tabler[#tabler]
- cLoop(ch[i],tablee["Poses"])
- end
- table.sort(tabler, Sort)
- return tabler
- end
- local motors = {}
- local animRuns = {}
- local origMotors = {}
- local MotorPriority = {}
- local playingM6d = {}
- function MainAnimation(char,Array,Speed,Name,Weld,Priority)
- local currentPM = {}
- local pri = {}
- for i=1, #Array do
- local poses = Array[i]["Poses"]
- local Time = Array[i]["Time"]
- if table.find(animRuns,Name) then
- for z,v in pairs(poses) do
- if table.find(animRuns,Name) then
- local Pose = v
- local descChar = char:GetDescendants()
- local motor
- local found = false
- for p=1, #descChar do
- local dc = descChar[p]
- if not Weld then
- if dc.ClassName == "Motor6D" then
- if dc.Part1.Name == Pose["Name"] then
- motor = dc
- found = true
- end
- end
- else
- if dc.ClassName == "Weld" then
- if dc.Part1.Name == Pose["Name"] then
- motor = dc
- found = true
- end
- end
- end
- end
- if found and motor ~= nil then
- if not table.find(motors, motor) then
- table.insert(motors, motor)
- table.insert(origMotors, motor.C0)
- end
- if not table.find(pri,motor) then
- table.insert(MotorPriority,{["Motor"]=motor,["Priority"]=Priority})
- table.insert(playingM6d, {["Motor"]=motor,["AnimName"]=Name})
- table.insert(currentPM,MotorPriority[#MotorPriority])
- table.insert(currentPM,MotorPriority[#playingM6d])
- table.insert(pri,motor)
- end
- local style
- local direction
- if Pose["EasingStyle"] == Enum.PoseEasingStyle.Linear then
- style = Enum.EasingStyle.Linear
- elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Cubic then
- style = Enum.EasingStyle.Cubic
- elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Bounce then
- style = Enum.EasingStyle.Bounce
- elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Elastic then
- style = Enum.EasingStyle.Elastic
- elseif Pose["EasingStyle"] == Enum.PoseEasingStyle.Constant then
- style = true
- end
- if Pose["EasingDirection"] == Enum.PoseEasingDirection.In then
- direction = Enum.EasingDirection.In
- elseif Pose["EasingDirection"] == Enum.PoseEasingDirection.InOut then
- direction = Enum.EasingDirection.InOut
- elseif Pose["EasingDirection"] == Enum.PoseEasingDirection.Out then
- direction = Enum.EasingDirection.Out
- end
- local stopANIM = false
- for r=1, #MotorPriority do
- if not table.find(currentPM,MotorPriority[r]) then
- if MotorPriority[r]["Motor"].Name == motor.Name then
- if Priority<MotorPriority[r]["Priority"] then
- stopANIM = true
- end
- end
- end
- end
- if not stopANIM then
- if origMotors[table.find(motors,motor)] ~= nil then
- if i~=1 then
- 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()
- else
- game:GetService("TweenService"):Create(motor,TweenInfo.new(0.01,style,direction),{C0 = origMotors[table.find(motors,motor)] * Pose["CFrame"]}):Play()
- end
- end
- end
- end
- end
- end
- end
- if table.find(animRuns,Name) then
- if i~=1 then
- task.wait(((Time-Array[i-1]["Time"])/2)/Speed)
- end
- end
- end
- delay(0.1, function()
- for i=1, #currentPM do
- if table.find(MotorPriority,table.find(MotorPriority,currentPM[i])) then
- table.remove(MotorPriority,table.find(MotorPriority,currentPM[i]))
- end
- if table.find(playingM6d,table.find(playingM6d,currentPM[i])) then
- table.remove(playingM6d,table.find(playingM6d,currentPM[i]))
- end
- end
- end)
- end
- function Play(char,Array,Speed,Name,looped,usewelds,Priority)
- if not looped then
- delay(0, function()
- if not table.find(animRuns,Name) then
- table.insert(animRuns,Name)
- end
- MainAnimation(char,Array,Speed,Name,usewelds,Priority)
- local motorschar = char:GetDescendants()
- for i=1, #motorschar do
- if not usewelds then
- if motorschar[i].ClassName == "Motor6D" then
- if table.find(motors,motorschar[i]) then
- local stop = false
- for r=1, #playingM6d do
- local cur = playingM6d[r]
- if cur["AnimName"] ~= Name then
- if cur["Motor"] == motorschar[i] then
- stop = true
- end
- end
- end
- if not stop then
- local origc0 = origMotors[table.find(motors,motorschar[i])]
- game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
- end
- end
- end
- else
- if motorschar[i].ClassName == "Weld" then
- if table.find(motors,motorschar[i]) then
- local stop = false
- for r=1, #playingM6d do
- local cur = playingM6d[r]
- if cur["AnimName"] ~= Name then
- if cur["Motor"] == motorschar[i] then
- stop = true
- end
- end
- end
- if not stop then
- local origc0 = origMotors[table.find(motors,motorschar[i])]
- game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
- end
- end
- end
- end
- end
- end)
- else
- delay(0, function()
- if not table.find(animRuns,Name) then
- table.insert(animRuns,Name)
- end
- while wait() do
- if table.find(animRuns,Name) then
- MainAnimation(char,Array,Speed,Name,usewelds,Priority)
- else
- break
- end
- end
- local motorschar = char:GetDescendants()
- for i=1, #motorschar do
- if not usewelds then
- if motorschar[i].ClassName == "Motor6D" then
- if table.find(motors,motorschar[i]) then
- local stop = false
- for r=1, #playingM6d do
- local cur = playingM6d[r]
- if cur["AnimName"] ~= Name then
- if cur["Motor"] == motorschar[i] then
- stop = true
- end
- end
- end
- if not stop then
- local origc0 = origMotors[table.find(motors,motorschar[i])]
- game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
- end
- end
- end
- else
- if motorschar[i].ClassName == "Weld" then
- if table.find(motors,motorschar[i]) then
- local stop = false
- for r=1, #playingM6d do
- local cur = playingM6d[r]
- if cur["AnimName"] ~= Name then
- if cur["Motor"] == motorschar[i] then
- stop = true
- end
- end
- end
- if not stop then
- local origc0 = origMotors[table.find(motors,motorschar[i])]
- game:GetService("TweenService"):Create(motorschar[i],TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{C0 = origc0}):Play()
- end
- end
- end
- end
- end
- end)
- end
- end
- function stop(AnimName)
- if table.find(animRuns,AnimName) then
- table.remove(animRuns,table.find(animRuns,AnimName))
- end
- end
- -- end
- local equip = {
- [1] = {
- ["Time"] = 0,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(0, 0, 0, 0.985996008, -0.166768745, 0, 0.166768745, 0.985996008, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [2] = {
- ["Time"] = 0.10000000149011612,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(0, 0, 0, 0.63876766, -0.769399703, 0, 0.769399703, 0.63876766, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [3] = {
- ["Time"] = 0.20000000298023224,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, 0.0680151582, -0.99768424, 0, 0.99768424, 0.0680151582, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [4] = {
- ["Time"] = 0.30000001192092896,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, -0.0296663344, -0.99955982, 0, 0.99955982, -0.0296663344, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- }
- }
- local idle = {
- [1] = {
- ["Time"] = 0,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, -0.0296663344, -0.99955982, 0, 0.99955982, -0.0296663344, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- }
- }
- local shoot = {
- [1] = {
- ["Time"] = 0,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(-0.210000038, -2.38418579e-07, 0, -0.140901208, -0.990023673, 0, 0.990023673, -0.140901208, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [2] = {
- ["Time"] = 0.06666667014360428,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(-0.455029488, 0.0231335163, 0, -0.267238319, -0.963630497, 0, 0.963630497, -0.267238319, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [3] = {
- ["Time"] = 0.13333334028720856,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [4] = {
- ["Time"] = 0.20000000298023224,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [5] = {
- ["Time"] = 0.30000001192092896,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [6] = {
- ["Time"] = 0.36666667461395264,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- },
- [7] = {
- ["Time"] = 0.46666666865348816,
- ["Poses"] = {
- ["Right Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Right Arm",
- ["Weight"] = 1,
- ["CFrame"] = CFrame.new(0, -2.38418579e-07, 0, -0.0296663344, -0.99955982, 0, 0.99955982, -0.0296663344, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Torso"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Torso",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["HumanoidRootPart"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "HumanoidRootPart",
- ["Weight"] = 0,
- ["CFrame"] = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- },
- ["Left Arm"] = {
- ["EasingStyle"] = Enum.PoseEasingStyle.Linear,
- ["Name"] = "Left Arm",
- ["Weight"] = 1,
- ["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),
- ["EasingDirection"] = Enum.PoseEasingDirection.In
- }
- }
- }
- }
- local player = owner
- local character = player.Character or player.CharacterAdded:Wait()
- local rem = Instance.new("RemoteEvent")
- rem.Name = "RMGTP"
- rem.Parent = character
- 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)
- local tool = Instance.new("Tool")
- tool.Parent = player.Backpack
- tool.Grip = CFrame.new(0.300000012, -0.5, 0.649999976, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- tool.Name = "Wormhole Tunneler"
- local Handle = Instance.new("Part")
- Handle.Parent = tool
- Handle.CanCollide = false
- Handle.Name = "Handle"
- Handle.Size = Vector3.new(1, 1.2, 2)
- local mesh = Instance.new("SpecialMesh")
- mesh.Parent = Handle
- mesh.MeshId = "http://www.roblox.com/asset/?id=34312118"
- mesh.TextureId = "http://www.roblox.com/asset/?id=34312142"
- function motortoweld(m)
- local weld = Instance.new("Weld")
- weld.Part0 = m.Part0
- weld.Part1 = m.Part1
- weld.C0 = m.C0
- weld.C1 = m.C1
- weld.Name = m.Name.. " Weld"
- return weld
- end
- local char
- local motorleftarm
- local motorrightarm
- local motortorso
- local torsoW
- local leftArmW
- local RightArmW
- tool.Equipped:Connect(function()
- task.wait(0.15)
- char = tool.Parent
- leftArmW = motortoweld(char.Torso["Left Shoulder"])
- RightArmW = motortoweld(char.Torso["Right Shoulder"])
- torsoW = motortoweld(char.HumanoidRootPart.RootJoint)
- motorleftarm = char.Torso["Left Shoulder"]
- motorrightarm = char.Torso["Right Shoulder"]
- motortorso = char.HumanoidRootPart.RootJoint
- char.Torso["Left Shoulder"].Enabled = false
- char.Torso["Right Shoulder"].Enabled = false
- char.HumanoidRootPart.RootJoint.Enabled = false
- leftArmW.Parent = char.Torso
- RightArmW.Parent = char.Torso
- torsoW.Parent = char.HumanoidRootPart
- Play(char,equip,0.5,"equip",false,true,2)
- Play(char,idle,0.5,"idle",true,true,1)
- end)
- tool.Unequipped:Connect(function()
- motorleftarm.Enabled = true
- motorrightarm.Enabled = true
- motortorso.Enabled = true
- torsoW:Destroy()
- leftArmW:Destroy()
- RightArmW:Destroy()
- stop("equip")
- stop("idle")
- stop("Shoot")
- end)
- local canshoot = true
- local cooldown = 0.4
- local portalHeight = 1
- local portalWidth = 10
- local currentP1
- local currentP1C = {}
- local cp1f
- local cp1 = true
- function newportal(pos,norm)
- local portal = Instance.new("Part")
- portal.Shape = "Cylinder"
- portal.Anchored = true
- portal.Reflectance = 1
- portal.Position = pos
- portal.Size = Vector3.new(portalHeight, portalWidth, portalWidth)
- portal.CFrame = CFrame.lookAt(pos,pos+norm) * CFrame.Angles(0,math.pi/2,0)
- portal.Parent = workspace
- if currentP1 ~= nil then
- currentP1:Destroy()
- end
- if cp1f ~= nil then
- cp1f:Disconnect()
- end
- local plrse=game.Players:GetChildren()
- for i=1, #currentP1C do
- currentP1C[i]["current"]:Destroy()
- end
- for i=1, #plrse do
- currentP1C[plrse[i].Name]={}
- end
- local SurfaceGui = Instance.new("SurfaceGui")
- local ViewportFrame = Instance.new("ViewportFrame")
- local UICorner = Instance.new("UICorner")
- SurfaceGui.Parent = portal
- SurfaceGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- SurfaceGui.Face = Enum.NormalId.Right
- SurfaceGui.LightInfluence = 1.000
- ViewportFrame.BackgroundTransparency = 1
- ViewportFrame.BorderSizePixel = 0
- ViewportFrame.Size = UDim2.new(1,0,1,0)
- ViewportFrame.BorderSizePixel = 0
- ViewportFrame.Parent = SurfaceGui
- ViewportFrame.Name = "vp"
- currentP1 = portal
- UICorner.CornerRadius = UDim.new(999999999, 0)
- UICorner.Parent = ViewportFrame
- cp1f = game:GetService("RunService").Heartbeat:Connect(function()
- if cp1 then
- for i=1, #plrse do
- local old
- if currentP1C[plrse[i].Name]["current"] ~= nil then
- old = currentP1C[plrse[i].Name]["current"]
- end
- currentP1C[plrse[i].Name]["current"] = SurfaceGui:Clone()
- local cl = currentP1C[plrse[i].Name]["current"]
- local players = game.Players:GetChildren()
- for r=1, #players do
- local c = players[i].Character
- if c ~= nil and cl:FindFirstChild("vp") then
- local charito = players[r].Character
- charito.Archivable = true
- charito:Clone().Parent = cl.vp
- end
- end
- if cl:FindFirstChild("vp") then
- local cam = Instance.new("Camera")
- cam.FieldOfView = 120
- cam.CFrame = portal.CFrame * CFrame.Angles(0,-math.pi/2,0)
- cl.vp.CurrentCamera = cam
- end
- delay(0.05, function()
- if currentP1C[plrse[i].Name]["current"] == cl then
- cl.Parent = player.PlayerGui
- cl.Adornee = portal
- end
- if old ~= nil then
- old:Destroy()
- end
- end)
- cp1 = false
- end
- end
- end)
- end
- rem.OnServerEvent:Connect(function(p,mh)
- print("Got")
- if canshoot then
- canshoot = false
- Play(char,shoot,0.5,"Shoot",false,true,2)
- local raypa = RaycastParams.new()
- raypa.FilterType = Enum.RaycastFilterType.Exclude
- raypa.FilterDescendantsInstances = {char}
- raypa.IgnoreWater = true
- local ray = Ray.new(char.HumanoidRootPart.Position, (mh.p - char.HumanoidRootPart.Position).unit * 300)
- local hit, position, normal = game.Workspace:FindPartOnRay(ray, tool.Parent)
- local distance = (position - char.HumanoidRootPart.Position).magnitude
- local part = Instance.new("Part")
- part.Anchored = true
- part.CanCollide = false
- part.Transparency = 0
- part.Color = Color3.new(0.0901961, 0.596078, 0.831373)
- part.Material = Enum.Material.Neon
- part.Size = Vector3.new(0.6, 0.6, distance)
- part.CFrame = CFrame.new(position, char.HumanoidRootPart.Position) * CFrame.new(0, 0, -distance / 2)
- part.Parent = workspace
- 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()
- delay(0.5, function()
- part:Destroy()
- end)
- if hit then
- newportal(position,normal)
- end
- wait(cooldown)
- canshoot = true
- end
- end)
- local portalUpd = 0.05
- while task.wait() do
- cp1 = true
- task.wait(portalUpd)
- end
Advertisement
Add Comment
Please, Sign In to add comment