Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Script0 = Instance.new("Script")
- Model1 = Instance.new("Model")
- Part2 = Instance.new("Part")
- MeshPart3 = Instance.new("MeshPart")
- Motor6D4 = Instance.new("Motor6D")
- MeshPart5 = Instance.new("MeshPart")
- Motor6D6 = Instance.new("Motor6D")
- MeshPart7 = Instance.new("MeshPart")
- Motor6D8 = Instance.new("Motor6D")
- MeshPart9 = Instance.new("MeshPart")
- Motor6D10 = Instance.new("Motor6D")
- MeshPart11 = Instance.new("MeshPart")
- Motor6D12 = Instance.new("Motor6D")
- MeshPart13 = Instance.new("MeshPart")
- Motor6D14 = Instance.new("Motor6D")
- MeshPart15 = Instance.new("MeshPart")
- Motor6D16 = Instance.new("Motor6D")
- MeshPart17 = Instance.new("MeshPart")
- Motor6D18 = Instance.new("Motor6D")
- MeshPart19 = Instance.new("MeshPart")
- Motor6D20 = Instance.new("Motor6D")
- MeshPart21 = Instance.new("MeshPart")
- Motor6D22 = Instance.new("Motor6D")
- MeshPart23 = Instance.new("MeshPart")
- Motor6D24 = Instance.new("Motor6D")
- MeshPart25 = Instance.new("MeshPart")
- Motor6D26 = Instance.new("Motor6D")
- MeshPart27 = Instance.new("MeshPart")
- Motor6D28 = Instance.new("Motor6D")
- MeshPart29 = Instance.new("MeshPart")
- Motor6D30 = Instance.new("Motor6D")
- MeshPart31 = Instance.new("MeshPart")
- Motor6D32 = Instance.new("Motor6D")
- Humanoid33 = Instance.new("Humanoid")
- Script34 = Instance.new("Script")
- StringValue35 = Instance.new("StringValue")
- Animation36 = Instance.new("Animation")
- StringValue37 = Instance.new("StringValue")
- Animation38 = Instance.new("Animation")
- StringValue39 = Instance.new("StringValue")
- Animation40 = Instance.new("Animation")
- NumberValue41 = Instance.new("NumberValue")
- Animation42 = Instance.new("Animation")
- NumberValue43 = Instance.new("NumberValue")
- StringValue44 = Instance.new("StringValue")
- Animation45 = Instance.new("Animation")
- StringValue46 = Instance.new("StringValue")
- Animation47 = Instance.new("Animation")
- StringValue48 = Instance.new("StringValue")
- Animation49 = Instance.new("Animation")
- StringValue50 = Instance.new("StringValue")
- Animation51 = Instance.new("Animation")
- StringValue52 = Instance.new("StringValue")
- Animation53 = Instance.new("Animation")
- StringValue54 = Instance.new("StringValue")
- Animation55 = Instance.new("Animation")
- StringValue56 = Instance.new("StringValue")
- Animation57 = Instance.new("Animation")
- Script58 = Instance.new("Script")
- LocalScript59 = Instance.new("LocalScript")
- Script60 = Instance.new("Script")
- LocalScript61 = Instance.new("LocalScript")
- ObjectValue62 = Instance.new("ObjectValue")
- Script0.Name = "abortion"
- Script0.Parent = mas
- table.insert(cors,sandbox(Script0,function()
- wait(2)
- local plr = game.Players["TameDoNotClick"]
- local chr = script.Model
- script.LocalScript.Obj.Value = chr
- for i,v in pairs(chr:GetChildren()) do
- if v:IsA("MeshPart") or v:IsA("Part") then
- v.Anchored = false
- end
- end
- plr.Character = chr
- local ae = script.LocalScript:Clone()
- ae.Parent = chr
- ae.Disabled = false
- chr.Parent = workspace
- script:Destroy()
- end))
- Model1.Parent = Script0
- Part2.Name = "HumanoidRootPart"
- Part2.Parent = Model1
- Part2.CFrame = CFrame.new(-118.261124, 368.847595, 128.503281, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.Position = Vector3.new(-118.261124, 368.847595, 128.503281)
- Part2.Transparency = 1
- Part2.Size = Vector3.new(2, 2, 1)
- Part2.Anchored = true
- MeshPart3.Name = "Head"
- MeshPart3.Parent = Model1
- MeshPart3.CFrame = CFrame.new(-118.298134, 370.732788, 128.527603, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart3.Position = Vector3.new(-118.298134, 370.732788, 128.527603)
- MeshPart3.Size = Vector3.new(0.558326721, 1.12706757, 0.824303746)
- MeshPart3.Anchored = true
- MeshPart3.TextureID = "http://roblox.com/asset/?id=1575203913 "
- Motor6D4.Name = "Neck"
- Motor6D4.Parent = MeshPart3
- Motor6D4.C0 = CFrame.new(-3.72726499e-05, 0.604157209, 0.0636235774, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D4.C1 = CFrame.new(0.037007343, -0.297998428, -0.0244880002, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D4.Part0 = MeshPart17
- Motor6D4.Part1 = MeshPart3
- Motor6D4.part1 = MeshPart3
- MeshPart5.Name = "LeftHand"
- MeshPart5.Parent = Model1
- MeshPart5.CFrame = CFrame.new(-119.415169, 368.669464, 128.200546, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart5.Position = Vector3.new(-119.415169, 368.669464, 128.200546)
- MeshPart5.Size = Vector3.new(0.349442005, 0.683714926, 0.406895608)
- MeshPart5.Anchored = true
- MeshPart5.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D6.Name = "LeftWrist"
- Motor6D6.Parent = MeshPart5
- Motor6D6.C0 = CFrame.new(0.0862908363, -0.735850811, 0.030328406, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D6.C1 = CFrame.new(0.273083448, -0.162624002, 0.302725077, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D6.Part0 = MeshPart7
- Motor6D6.Part1 = MeshPart5
- Motor6D6.part1 = MeshPart5
- MeshPart7.Name = "LeftLowerArm"
- MeshPart7.Parent = Model1
- MeshPart7.CFrame = CFrame.new(-119.228378, 369.242676, 128.472946, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart7.Position = Vector3.new(-119.228378, 369.242676, 128.472946)
- MeshPart7.Size = Vector3.new(0.486420631, 0.680185199, 0.497122139)
- MeshPart7.Anchored = true
- MeshPart7.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D8.Name = "LeftElbow"
- Motor6D8.Parent = MeshPart7
- Motor6D8.C0 = CFrame.new(-0.23034811, -0.515464664, -0.216402858, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D8.C1 = CFrame.new(0.0862905979, 0.0953008235, 0.0303284079, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D8.Part0 = MeshPart9
- Motor6D8.Part1 = MeshPart7
- Motor6D8.part1 = MeshPart7
- MeshPart9.Name = "LeftUpperArm"
- MeshPart9.Parent = Model1
- MeshPart9.CFrame = CFrame.new(-118.911743, 369.853455, 128.719681, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart9.Position = Vector3.new(-118.911743, 369.853455, 128.719681)
- MeshPart9.Size = Vector3.new(0.604062498, 0.909634709, 0.639819801)
- MeshPart9.Anchored = true
- MeshPart9.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D10.Name = "LeftShoulder"
- Motor6D10.Parent = MeshPart9
- Motor6D10.C0 = CFrame.new(-0.587371826, 0.424993038, 0.0638954192, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D10.C1 = CFrame.new(0.0632876158, 0.402154207, -0.216287896, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D10.Part0 = MeshPart17
- Motor6D10.Part1 = MeshPart9
- Motor6D10.part1 = MeshPart9
- MeshPart11.Name = "RightHand"
- MeshPart11.Parent = Model1
- MeshPart11.CFrame = CFrame.new(-117.107231, 368.66745, 128.200562, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart11.Position = Vector3.new(-117.107231, 368.66745, 128.200562)
- MeshPart11.Size = Vector3.new(0.349441767, 0.67964983, 0.406895608)
- MeshPart11.Anchored = true
- MeshPart11.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D12.Name = "RightWrist"
- Motor6D12.Parent = MeshPart11
- Motor6D12.C0 = CFrame.new(-0.0830709338, -0.737294018, 0.0290398747, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D12.C1 = CFrame.new(-0.272919953, -0.160591334, 0.302725077, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D12.Part0 = MeshPart13
- Motor6D12.Part1 = MeshPart11
- Motor6D12.part1 = MeshPart11
- MeshPart13.Name = "RightLowerArm"
- MeshPart13.Parent = Model1
- MeshPart13.CFrame = CFrame.new(-117.297081, 369.244141, 128.474243, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart13.Position = Vector3.new(-117.297081, 369.244141, 128.474243)
- MeshPart13.Size = Vector3.new(0.485559523, 0.683071792, 0.499699205)
- MeshPart13.Anchored = true
- MeshPart13.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D14.Name = "RightElbow"
- Motor6D14.Parent = MeshPart13
- Motor6D14.C0 = CFrame.new(0.225879133, -0.510890603, -0.0778696835, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D14.C1 = CFrame.new(-0.0830711126, 0.0938575268, 0.0290398747, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D14.Part0 = MeshPart15
- Motor6D14.Part1 = MeshPart13
- Motor6D14.part1 = MeshPart13
- MeshPart15.Name = "RightUpperArm"
- MeshPart15.Parent = Model1
- MeshPart15.CFrame = CFrame.new(-117.606033, 369.848877, 128.581146, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart15.Position = Vector3.new(-117.606033, 369.848877, 128.581146)
- MeshPart15.Size = Vector3.new(0.595734, 0.918782651, 0.36275351)
- MeshPart15.Anchored = true
- MeshPart15.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D16.Name = "RightShoulder"
- Motor6D16.Parent = MeshPart15
- Motor6D16.C0 = CFrame.new(0.587271214, 0.424993038, 0.0635934696, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D16.C1 = CFrame.new(-0.0677824616, 0.406728268, -0.0780566707, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D16.Part0 = MeshPart17
- Motor6D16.Part1 = MeshPart15
- Motor6D16.part1 = MeshPart15
- MeshPart17.Name = "UpperTorso"
- MeshPart17.Parent = Model1
- MeshPart17.CFrame = CFrame.new(-118.261086, 369.830627, 128.439499, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart17.Position = Vector3.new(-118.261086, 369.830627, 128.439499)
- MeshPart17.Size = Vector3.new(1.14802361, 1.31227541, 0.832659066)
- MeshPart17.Anchored = true
- MeshPart17.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D18.Name = "Waist"
- Motor6D18.Parent = MeshPart17
- Motor6D18.C0 = CFrame.new(8.15391541e-05, 0.273116827, 0.0413134396, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D18.C1 = CFrame.new(-3.72827053e-05, -0.608006954, 0.0637804568, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D18.Part0 = MeshPart31
- Motor6D18.Part1 = MeshPart17
- Motor6D18.part1 = MeshPart17
- MeshPart19.Name = "LeftFoot"
- MeshPart19.Parent = Model1
- MeshPart19.CFrame = CFrame.new(-118.787308, 366.023407, 128.407364, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart19.Position = Vector3.new(-118.787308, 366.023407, 128.407364)
- MeshPart19.Size = Vector3.new(0.394467115, 0.446739435, 0.816779494)
- MeshPart19.Anchored = true
- MeshPart19.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D20.Name = "LeftAnkle"
- Motor6D20.Parent = MeshPart19
- Motor6D20.C0 = CFrame.new(0.130149275, -0.794970036, -0.0444255695, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D20.C1 = CFrame.new(0.216528803, 0.109665871, 0.0959113017, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D20.Part0 = MeshPart21
- Motor6D20.Part1 = MeshPart19
- Motor6D20.part1 = MeshPart19
- MeshPart21.Name = "LeftLowerLeg"
- MeshPart21.Parent = Model1
- MeshPart21.CFrame = CFrame.new(-118.700928, 366.92804, 128.547699, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart21.Position = Vector3.new(-118.700928, 366.92804, 128.547699)
- MeshPart21.Size = Vector3.new(0.48820281, 1.49119866, 0.566404998)
- MeshPart21.Anchored = true
- MeshPart21.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D22.Name = "LeftKnee"
- Motor6D22.Parent = MeshPart21
- Motor6D22.C0 = CFrame.new(0.0204916298, -0.762124181, 0.0624910519, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D22.C1 = CFrame.new(0.130149305, 0.588028312, -0.0444198772, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D22.Part0 = MeshPart23
- Motor6D22.Part1 = MeshPart21
- Motor6D22.part1 = MeshPart21
- MeshPart23.Name = "LeftUpperLeg"
- MeshPart23.Parent = Model1
- MeshPart23.CFrame = CFrame.new(-118.59127, 368.278198, 128.440781, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart23.Position = Vector3.new(-118.59127, 368.278198, 128.440781)
- MeshPart23.Size = Vector3.new(0.620733321, 1.55217934, 0.683645964)
- MeshPart23.Anchored = true
- MeshPart23.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D24.Name = "LeftHip"
- Motor6D24.Parent = MeshPart23
- Motor6D24.C0 = CFrame.new(-0.309571236, -0.101883173, 0.0413134396, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D24.C1 = CFrame.new(0.0204916, 0.569408417, 0.062496528, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D24.Part0 = MeshPart31
- Motor6D24.Part1 = MeshPart23
- Motor6D24.part1 = MeshPart23
- MeshPart25.Name = "RightFoot"
- MeshPart25.Parent = Model1
- MeshPart25.CFrame = CFrame.new(-117.735107, 366.023376, 128.407349, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart25.Position = Vector3.new(-117.735107, 366.023376, 128.407349)
- MeshPart25.Size = Vector3.new(0.394466639, 0.446739197, 0.816779494)
- MeshPart25.Anchored = true
- MeshPart25.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D26.Name = "RightAnkle"
- Motor6D26.Parent = MeshPart25
- Motor6D26.C0 = CFrame.new(-0.141433001, -0.846741319, 0.0336278155, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D26.C1 = CFrame.new(-0.215695024, 0.109664679, 0.0959582999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D26.Part0 = MeshPart27
- Motor6D26.Part1 = MeshPart25
- Motor6D26.part1 = MeshPart25
- MeshPart27.Name = "RightLowerLeg"
- MeshPart27.Parent = Model1
- MeshPart27.CFrame = CFrame.new(-117.809372, 366.979797, 128.469681, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart27.Position = Vector3.new(-117.809372, 366.979797, 128.469681)
- MeshPart27.Size = Vector3.new(0.562960148, 1.63152242, 0.733001888)
- MeshPart27.Anchored = true
- MeshPart27.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D28.Name = "RightKnee"
- Motor6D28.Parent = MeshPart27
- Motor6D28.C0 = CFrame.new(-0.022497654, -0.754441321, 0.0520723537, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D28.C1 = CFrame.new(-0.141433001, 0.536258936, 0.0336021259, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D28.Part0 = MeshPart29
- Motor6D28.Part1 = MeshPart27
- Motor6D28.part1 = MeshPart27
- MeshPart29.Name = "RightUpperLeg"
- MeshPart29.Parent = Model1
- MeshPart29.CFrame = CFrame.new(-117.928307, 368.270508, 128.451218, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart29.Position = Vector3.new(-117.928307, 368.270508, 128.451218)
- MeshPart29.Size = Vector3.new(0.596929073, 1.53314316, 0.662777305)
- MeshPart29.Anchored = true
- MeshPart29.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D30.Name = "RightHip"
- Motor6D30.Parent = MeshPart29
- Motor6D30.C0 = CFrame.new(0.310404778, -0.101883173, 0.0413134396, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D30.C1 = CFrame.new(-0.022497654, 0.5770908, 0.0520622134, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D30.Part0 = MeshPart31
- Motor6D30.Part1 = MeshPart29
- Motor6D30.part1 = MeshPart29
- MeshPart31.Name = "LowerTorso"
- MeshPart31.Parent = Model1
- MeshPart31.CFrame = CFrame.new(-118.261208, 368.949493, 128.46196, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- MeshPart31.Position = Vector3.new(-118.261208, 368.949493, 128.46196)
- MeshPart31.Size = Vector3.new(1.07167053, 0.688970566, 0.807805061)
- MeshPart31.Anchored = true
- MeshPart31.TextureID = "http://roblox.com/asset/?id=1575206613 "
- Motor6D32.Name = "Root"
- Motor6D32.Parent = MeshPart31
- Motor6D32.C0 = CFrame.new(-0, 3.75157256e-08, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D32.C1 = CFrame.new(8.15391541e-05, -0.101883136, 0.0413134396, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D32.Part0 = Part2
- Motor6D32.Part1 = MeshPart31
- Motor6D32.part1 = MeshPart31
- Humanoid33.Parent = Model1
- Humanoid33.HipHeight = 2
- Humanoid33.LeftLeg = MeshPart23
- Humanoid33.RigType = Enum.HumanoidRigType.R15
- Humanoid33.RightLeg = MeshPart29
- Humanoid33.Torso = Part2
- Script34.Name = "Animate"
- Script34.Parent = Model1
- table.insert(cors,sandbox(Script34,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimInstance = nil
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
- { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
- { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=507777826", weight = 10 }
- },
- run = {
- { id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
- },
- swim = {
- { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
- },
- swimidle = {
- { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
- },
- sit = {
- { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
- },
- dance = {
- { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
- },
- }
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- math.randomseed(tick())
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- -- print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.31
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.2
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- currentAnimInstance = nil
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
- repeatAnim = "idle"
- end
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.15, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- switch animation
- if (anim ~= currentAnimInstance) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- currentAnimInstance = anim
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local toolAnimInstance = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- playToolAnimation(toolAnimName, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- if (toolAnimInstance ~= anim) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- toolAnimInstance = anim
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- toolAnimInstance = nil
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed > 0.01 then
- local scale = 15.0
- playAnimation("walk", 0.1, Humanoid)
- setAnimationSpeed(speed / scale)
- pose = "Running"
- else
- if emoteNames[currentAnim] == nil then
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- local scale = 5.0
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / scale)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed > 1.00 then
- local scale = 10.0
- playAnimation("swim", 0.4, Humanoid)
- setAnimationSpeed(speed / scale)
- pose = "Swimming"
- else
- playAnimation("swimidle", 0.4, Humanoid)
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- playAnimation("sit", 0.5, Humanoid)
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- stopAllAnimations()
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool and (tool.RequiresHandle or tool:FindFirstChild("Handle")) then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimInstance = nil
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- main program
- local runService = game:service("RunService");
- -- print("bottom")
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue35.Name = "climb"
- StringValue35.Parent = Script34
- Animation36.Name = "ClimbAnim"
- Animation36.Parent = StringValue35
- Animation36.AnimationId = "http://www.roblox.com/asset/?id=507765644"
- StringValue37.Name = "fall"
- StringValue37.Parent = Script34
- Animation38.Name = "FallAnim"
- Animation38.Parent = StringValue37
- Animation38.AnimationId = "http://www.roblox.com/asset/?id=507767968"
- StringValue39.Name = "idle"
- StringValue39.Parent = Script34
- Animation40.Name = "Animation1"
- Animation40.Parent = StringValue39
- Animation40.AnimationId = "http://www.roblox.com/asset/?id=507766388"
- NumberValue41.Name = "Weight"
- NumberValue41.Parent = Animation40
- NumberValue41.Value = 9
- Animation42.Name = "Animation2"
- Animation42.Parent = StringValue39
- Animation42.AnimationId = "http://www.roblox.com/asset/?id=507766666"
- NumberValue43.Name = "Weight"
- NumberValue43.Parent = Animation42
- NumberValue43.Value = 1
- StringValue44.Name = "jump"
- StringValue44.Parent = Script34
- Animation45.Name = "JumpAnim"
- Animation45.Parent = StringValue44
- Animation45.AnimationId = "http://www.roblox.com/asset/?id=507765000"
- StringValue46.Name = "run"
- StringValue46.Parent = Script34
- Animation47.Name = "RunAnim"
- Animation47.Parent = StringValue46
- Animation47.AnimationId = "http://www.roblox.com/asset/?id=5077677142"
- StringValue48.Name = "sit"
- StringValue48.Parent = Script34
- Animation49.Name = "SitAnim"
- Animation49.Parent = StringValue48
- Animation49.AnimationId = "http://www.roblox.com/asset/?id=507768133"
- StringValue50.Name = "swim"
- StringValue50.Parent = Script34
- Animation51.Name = "Swim"
- Animation51.Parent = StringValue50
- Animation51.AnimationId = "http://www.roblox.com/asset/?id=507784897"
- StringValue52.Name = "swimidle"
- StringValue52.Parent = Script34
- Animation53.Name = "SwimIdle"
- Animation53.Parent = StringValue52
- Animation53.AnimationId = "http://www.roblox.com/asset/?id=481825862"
- StringValue54.Name = "toolnone"
- StringValue54.Parent = Script34
- Animation55.Name = "ToolNoneAnim"
- Animation55.Parent = StringValue54
- Animation55.AnimationId = "http://www.roblox.com/asset/?id=507768375"
- StringValue56.Name = "walk"
- StringValue56.Parent = Script34
- Animation57.Name = "RunAnim"
- Animation57.Parent = StringValue56
- Animation57.AnimationId = "http://www.roblox.com/asset/?id=507777826"
- Script58.Name = "Sound"
- Script58.Parent = Model1
- table.insert(cors,sandbox(Script58,function()
- --[[
- Author: @spotco
- This script creates sounds which are placed under the character head.
- These sounds are used by the "LocalSound" script.
- To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
- The default Sound script loaded for every character will then be replaced with your copy of the script.
- ]]--
- function CreateNewSound(name, id, looped, pitch, parent)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.Name = name
- sound.archivable = false
- sound.Parent = parent
- sound.Pitch = pitch
- sound.Looped = looped
- sound.MinDistance = 5
- sound.MaxDistance = 150
- sound.Volume = 0.65
- return sound
- end
- local head = script.Parent:FindFirstChild("Head")
- if head == nil then
- error("Sound script parent has no child Head.")
- return
- end
- CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
- CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
- CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
- CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
- CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
- CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
- CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
- CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
- CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
- end))
- LocalScript59.Name = "LocalSound"
- LocalScript59.Parent = Script58
- table.insert(cors,sandbox(LocalScript59,function()
- --[[
- Author: @spotco
- This script runs locally for the player of the given humanoid.
- This script triggers humanoid sound play/pause actions locally.
- The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
- immediately for the player and is replicated to all other players.
- This script is optimized to reduce network traffic through minimizing the amount of property replication.
- ]]--
- --All sounds are referenced by this ID
- local SFX = {
- Died = 0;
- Running = 1;
- Swimming = 2;
- Climbing = 3,
- Jumping = 4;
- GettingUp = 5;
- FreeFalling = 6;
- FallingDown = 7;
- Landing = 8;
- Splash = 9;
- }
- local Humanoid = nil
- local Head = nil
- --SFX ID to Sound object
- local Sounds = {}
- do
- local Figure = script.Parent.Parent
- Head = Figure:WaitForChild("Head")
- while not Humanoid do
- for _,NewHumanoid in pairs(Figure:GetChildren()) do
- if NewHumanoid:IsA("Humanoid") then
- Humanoid = NewHumanoid
- break
- end
- end
- Figure.ChildAdded:wait()
- end
- Sounds[SFX.Died] = Head:WaitForChild("Died")
- Sounds[SFX.Running] = Head:WaitForChild("Running")
- Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
- Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
- Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
- Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
- Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
- Sounds[SFX.Landing] = Head:WaitForChild("Landing")
- Sounds[SFX.Splash] = Head:WaitForChild("Splash")
- end
- local Util
- Util = {
- --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
- YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
- --(y - y1)/(x - x1) = m
- local m = (pt1y - pt2y) / (pt1x - pt2x)
- --float b = pt1.y - m * pt1.x;
- local b = (pt1y - m * pt1x)
- return m * x + b
- end;
- --Clamps the value of "val" between the "min" and "max"
- Clamp = function(val,min,max)
- return math.min(max,math.max(min,val))
- end;
- --Gets the horizontal (x,z) velocity magnitude of the given part
- HorizontalSpeed = function(Head)
- local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
- return hVel.magnitude
- end;
- --Gets the vertical (y) velocity magnitude of the given part
- VerticalSpeed = function(Head)
- return math.abs(Head.Velocity.Y)
- end;
- --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
- --If these properties are enabled, use them.
- Play = function(sound)
- if sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- if not sound.IsPlaying then
- sound.Playing = true
- end
- end;
- Pause = function(sound)
- if sound.IsPlaying then
- sound.Playing = false
- end
- end;
- Resume = function(sound)
- if not sound.IsPlaying then
- sound.Playing = true
- end
- end;
- Stop = function(sound)
- if sound.IsPlaying then
- sound.Playing = false
- end
- if sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- end;
- }
- do
- -- List of all active Looped sounds
- local playingLoopedSounds = {}
- -- Last seen Enum.HumanoidStateType
- local activeState = nil
- -- Verify and set that "sound" is in "playingLoopedSounds".
- function setSoundInPlayingLoopedSounds(sound)
- for i=1, #playingLoopedSounds do
- if playingLoopedSounds[i] == sound then
- return
- end
- end
- table.insert(playingLoopedSounds,sound)
- end
- -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
- function stopPlayingLoopedSoundsExcept(except)
- for i=#playingLoopedSounds,1,-1 do
- if playingLoopedSounds[i] ~= except then
- Util.Pause(playingLoopedSounds[i])
- table.remove(playingLoopedSounds,i)
- end
- end
- end
- -- Table of Enum.HumanoidStateType to handling function
- local stateUpdateHandler = {
- [Enum.HumanoidStateType.Dead] = function()
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.Died]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.RunningNoPhysics] = function()
- stateUpdated(Enum.HumanoidStateType.Running)
- end;
- [Enum.HumanoidStateType.Running] = function()
- local sound = Sounds[SFX.Running]
- stopPlayingLoopedSoundsExcept(sound)
- if Util.HorizontalSpeed(Head) > 0.5 then
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- else
- stopPlayingLoopedSoundsExcept()
- end
- end;
- [Enum.HumanoidStateType.Swimming] = function()
- if activeState ~= Enum.HumanoidStateType.Swimming and Util.VerticalSpeed(Head) > 0.1 then
- local splashSound = Sounds[SFX.Splash]
- splashSound.Volume = Util.Clamp(
- Util.YForLineGivenXAndTwoPts(
- Util.VerticalSpeed(Head),
- 100, 0.28,
- 350, 1),
- 0,1)
- Util.Play(splashSound)
- end
- do
- local sound = Sounds[SFX.Swimming]
- stopPlayingLoopedSoundsExcept(sound)
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- end
- end;
- [Enum.HumanoidStateType.Climbing] = function()
- local sound = Sounds[SFX.Climbing]
- if Util.VerticalSpeed(Head) > 0.1 then
- Util.Resume(sound)
- stopPlayingLoopedSoundsExcept(sound)
- else
- stopPlayingLoopedSoundsExcept()
- end
- setSoundInPlayingLoopedSounds(sound)
- end;
- [Enum.HumanoidStateType.Jumping] = function()
- if activeState == Enum.HumanoidStateType.Jumping then
- return
- end
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.Jumping]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.GettingUp] = function()
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.GettingUp]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.Freefall] = function()
- if activeState == Enum.HumanoidStateType.Freefall then
- return
- end
- local sound = Sounds[SFX.FreeFalling]
- sound.Volume = 0
- stopPlayingLoopedSoundsExcept()
- end;
- [Enum.HumanoidStateType.FallingDown] = function()
- stopPlayingLoopedSoundsExcept()
- end;
- [Enum.HumanoidStateType.Landed] = function()
- stopPlayingLoopedSoundsExcept()
- if Util.VerticalSpeed(Head) > 75 then
- local landingSound = Sounds[SFX.Landing]
- landingSound.Volume = Util.Clamp(
- Util.YForLineGivenXAndTwoPts(
- Util.VerticalSpeed(Head),
- 50, 0,
- 100, 1),
- 0,1)
- Util.Play(landingSound)
- end
- end;
- [Enum.HumanoidStateType.Seated] = function()
- stopPlayingLoopedSoundsExcept()
- end;
- }
- -- Handle state event fired or OnChange fired
- function stateUpdated(state)
- if stateUpdateHandler[state] ~= nil then
- stateUpdateHandler[state]()
- end
- activeState = state
- end
- Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
- Humanoid.Running:connect( function() stateUpdated(Enum.HumanoidStateType.Running) end)
- Humanoid.Swimming:connect( function() stateUpdated(Enum.HumanoidStateType.Swimming) end)
- Humanoid.Climbing:connect( function() stateUpdated(Enum.HumanoidStateType.Climbing) end)
- Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
- Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
- Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
- Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
- -- required for proper handling of Landed event
- Humanoid.StateChanged:connect(function(old, new)
- stateUpdated(new)
- end)
- function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
- local stepScale = stepDeltaSeconds / tickSpeedSeconds
- do
- local sound = Sounds[SFX.FreeFalling]
- if activeState == Enum.HumanoidStateType.Freefall then
- if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
- Util.Resume(sound)
- --Volume takes 1.1 seconds to go from volume 0 to 1
- local ANIMATION_LENGTH_SECONDS = 1.1
- local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
- sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
- else
- sound.Volume = 0
- end
- else
- Util.Pause(sound)
- end
- end
- do
- local sound = Sounds[SFX.Running]
- if activeState == Enum.HumanoidStateType.Running then
- if Util.HorizontalSpeed(Head) < 0.5 then
- Util.Pause(sound)
- end
- end
- end
- end
- local lastTick = tick()
- local TICK_SPEED_SECONDS = 0.25
- while true do
- onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
- lastTick = tick()
- wait(TICK_SPEED_SECONDS)
- end
- end
- end))
- Script60.Name = "Health"
- Script60.Parent = Model1
- table.insert(cors,sandbox(Script60,function()
- --Responsible for regening a player's humanoid's health
- -- declarations
- local Figure = script.Parent
- local Head = Figure:WaitForChild("Head")
- local Humanoid = Figure:WaitForChild("Humanoid")
- local regening = false
- -- regeneration
- function regenHealth()
- if regening then return end
- regening = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local s = wait(1)
- local health = Humanoid.Health
- if health > 0 and health < Humanoid.MaxHealth then
- local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
- health = health + newHealthDelta
- Humanoid.Health = math.min(health,Humanoid.MaxHealth)
- end
- end
- if Humanoid.Health > Humanoid.MaxHealth then
- Humanoid.Health = Humanoid.MaxHealth
- end
- regening = false
- end
- Humanoid.HealthChanged:connect(regenHealth)
- end))
- LocalScript61.Parent = Script0
- table.insert(cors,sandbox(LocalScript61,function()
- repeat wait() until script:FindFirstChild("Obj").Value
- workspace.Camera.CameraSubject = script.Obj.Value
- end))
- LocalScript61.Disabled = true
- ObjectValue62.Name = "Obj"
- ObjectValue62.Parent = LocalScript61
- ObjectValue62.Value = Model1
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement