Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Created with PenguinAnonymous's compiler
- --PenguinAnonymous is not responsible for damages caused to your game
- --This plugin does not remove things
- --PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
- --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
- --Thank you for using my plugin and enjoy :)
- --It is free to use
- --If you use this plugin to create your own, please give me credit
- --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
- --Errors: MeshPart,Attachment,TouchTransmitter,Animator,UnionOperation
- local runDummyScript = function(f,scri)
- local oldenv = getfenv(f)
- local newenv = setmetatable({}, {
- __index = function(_, k)
- if k:lower() == 'script' then
- return scri
- else
- return oldenv[k]
- end
- end
- })
- setfenv(f, newenv)
- ypcall(function() f() end)
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- mas.Name = "CompiledModel"
- o1 = Instance.new("Model")
- o2 = Instance.new("Model")
- o5 = Instance.new("Vector3Value")
- o6 = Instance.new("ManualWeld")
- o7 = Instance.new("Motor6D")
- o8 = Instance.new("ManualWeld")
- o9 = Instance.new("ManualWeld")
- o13 = Instance.new("Vector3Value")
- o14 = Instance.new("Motor6D")
- o15 = Instance.new("ParticleEmitter")
- o16 = Instance.new("Script")
- o20 = Instance.new("Vector3Value")
- o21 = Instance.new("Script")
- o22 = Instance.new("Motor6D")
- o23 = Instance.new("Script")
- o24 = Instance.new("Script")
- o29 = Instance.new("Vector3Value")
- o30 = Instance.new("Motor6D")
- o35 = Instance.new("Motor6D")
- o36 = Instance.new("Vector3Value")
- o40 = Instance.new("Vector3Value")
- o41 = Instance.new("Motor6D")
- o50 = Instance.new("Motor6D")
- o51 = Instance.new("Vector3Value")
- o52 = Instance.new("Script")
- o55 = Instance.new("Vector3Value")
- o56 = Instance.new("Motor6D")
- o57 = Instance.new("ManualWeld")
- o58 = Instance.new("ManualWeld")
- o62 = Instance.new("Vector3Value")
- o63 = Instance.new("Motor6D")
- o64 = Instance.new("ParticleEmitter")
- o65 = Instance.new("Script")
- o69 = Instance.new("Vector3Value")
- o70 = Instance.new("Script")
- o71 = Instance.new("Motor6D")
- o72 = Instance.new("Script")
- o73 = Instance.new("Script")
- o78 = Instance.new("Vector3Value")
- o79 = Instance.new("Motor6D")
- o84 = Instance.new("Motor6D")
- o85 = Instance.new("Vector3Value")
- o89 = Instance.new("Vector3Value")
- o90 = Instance.new("Motor6D")
- o91 = Instance.new("Script")
- o92 = Instance.new("Humanoid")
- o94 = Instance.new("Script")
- o104 = Instance.new("Motor6D")
- o105 = Instance.new("Vector3Value")
- o106 = Instance.new("ParticleEmitter")
- o107 = Instance.new("Script")
- o108 = Instance.new("StringValue")
- o109 = Instance.new("Animation")
- o110 = Instance.new("StringValue")
- o111 = Instance.new("Animation")
- o112 = Instance.new("StringValue")
- o113 = Instance.new("Animation")
- o114 = Instance.new("NumberValue")
- o115 = Instance.new("Animation")
- o116 = Instance.new("NumberValue")
- o117 = Instance.new("Animation")
- o118 = Instance.new("NumberValue")
- o119 = Instance.new("StringValue")
- o120 = Instance.new("Animation")
- o121 = Instance.new("NumberValue")
- o122 = Instance.new("Animation")
- o123 = Instance.new("NumberValue")
- o124 = Instance.new("Animation")
- o125 = Instance.new("NumberValue")
- o126 = Instance.new("StringValue")
- o127 = Instance.new("Animation")
- o128 = Instance.new("NumberValue")
- o129 = Instance.new("Animation")
- o130 = Instance.new("NumberValue")
- o131 = Instance.new("Animation")
- o132 = Instance.new("NumberValue")
- o133 = Instance.new("StringValue")
- o134 = Instance.new("Animation")
- o135 = Instance.new("StringValue")
- o136 = Instance.new("Animation")
- o137 = Instance.new("NumberValue")
- o138 = Instance.new("Animation")
- o139 = Instance.new("NumberValue")
- o140 = Instance.new("Animation")
- o141 = Instance.new("NumberValue")
- o142 = Instance.new("StringValue")
- o143 = Instance.new("Animation")
- o144 = Instance.new("StringValue")
- o145 = Instance.new("Animation")
- o146 = Instance.new("StringValue")
- o147 = Instance.new("Animation")
- o148 = Instance.new("StringValue")
- o149 = Instance.new("Animation")
- o150 = Instance.new("StringValue")
- o151 = Instance.new("Animation")
- o152 = Instance.new("StringValue")
- o153 = Instance.new("Animation")
- o154 = Instance.new("StringValue")
- o155 = Instance.new("Animation")
- o156 = Instance.new("StringValue")
- o157 = Instance.new("Animation")
- o158 = Instance.new("StringValue")
- o159 = Instance.new("Animation")
- o160 = Instance.new("StringValue")
- o161 = Instance.new("Animation")
- o162 = Instance.new("StringValue")
- o163 = Instance.new("Animation")
- o164 = Instance.new("StringValue")
- o165 = Instance.new("Animation")
- o166 = Instance.new("Part")
- o168 = Instance.new("Vector3Value")
- o169 = Instance.new("Part")
- o170 = Instance.new("SpecialMesh")
- o177 = Instance.new("Motor6D")
- o178 = Instance.new("Vector3Value")
- o179 = Instance.new("Sound")
- o180 = Instance.new("Sound")
- o181 = Instance.new("Sound")
- o182 = Instance.new("Sound")
- o183 = Instance.new("Sound")
- o184 = Instance.new("Sound")
- o185 = Instance.new("Sound")
- o186 = Instance.new("Sound")
- o187 = Instance.new("Sound")
- o188 = Instance.new("Script")
- o189 = Instance.new("Script")
- o190 = Instance.new("Model")
- o191 = Instance.new("Part")
- o192 = Instance.new("Part")
- o194 = Instance.new("ParticleEmitter")
- o195 = Instance.new("Script")
- o197 = Instance.new("Part")
- o200 = Instance.new("ManualWeld")
- o1.Name = "Boss-Furnace Zombie"
- o1.Parent = mas
- o2.Name = "Furnace Zombie"
- o2.Parent = o1
- o5.Name = "OriginalSize"
- o5.Parent = mas
- o5.Value = Vector3.new(1.00063133, 0.335407257, 1.00020337)
- o6.Name = "LeftFoot Terrain Joint"
- o6.Parent = mas
- o6.Part1 = mas
- o7.Name = "LeftAnkle"
- o7.Parent = mas
- o7.C0 = CFrame.new(-0.00382620096, -0.710131407, 0.00030554086, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o7.C1 = CFrame.new(-0.00901681185, 0.032443285, 0.000177569687, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o7.Part0 = mas
- o7.Part1 = mas
- o7.CurrentAngle = 0.053525634109974
- o8.Name = "LeftFoot Terrain Joint"
- o8.Parent = mas
- o8.Part1 = mas
- o9.Name = "LeftFoot Terrain Joint"
- o9.Parent = mas
- o9.Part1 = mas
- o13.Name = "OriginalSize"
- o13.Parent = mas
- o13.Value = Vector3.new(0.999299049, 0.335255831, 1.00029743)
- o14.Name = "LeftWrist"
- o14.Parent = mas
- o14.C0 = CFrame.new(-0.0016657114, -0.682255626, -0.00989592075, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o14.C1 = CFrame.new(-0.000386238098, 0.0579008311, -0.0154390335, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o14.Part0 = mas
- o14.Part1 = mas
- o15.Name = "FireParticle"
- o15.Parent = mas
- o15.Rotation = NumberRange.new(100000,100000)
- o15.Size = NumberSequence.new(1.1731845140457,0.75,0.3846150636673,0)
- o15.Color = ColorSequence.new(Color3.new(1, 0.333333, 0),Color3.new(1, 0, 0))
- o15.LightEmission = 0.75
- o15.Texture = "rbxasset://textures/particles/explosion01_implosion_main.dds"
- o15.ZOffset = 1
- o15.Acceleration = Vector3.new(0, 300, 0)
- o15.Lifetime = NumberRange.new(0.20000000298023,0.20000000298023)
- o15.Rate = 200
- o15.RotSpeed = NumberRange.new(1,1)
- o15.Speed = NumberRange.new(0,0)
- o16.Parent = o15
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.Enabled = false
- wait(20)
- script.Parent.Enabled = true
- wait(5)
- end
- end,o16)
- end))
- o20.Name = "OriginalSize"
- o20.Parent = mas
- o20.Value = Vector3.new(1.00027657, 1.26567209, 1.00025082)
- o21.Name = "Damage Script"
- o21.Parent = mas
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function onTouched(hit)
- local human = hit.Parent:findFirstChild("Humanoid")
- if (human ~= nil) then
- human.Health = human.Health - 5 -- Change the amount to change the damage.
- end
- end
- script.Parent.Touched:connect(onTouched)
- end,o21)
- end))
- o22.Name = "LeftElbow"
- o22.Parent = mas
- o22.C0 = CFrame.new(-0.00166511536, -0.263139546, -0.00943991542, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o22.C1 = CFrame.new(-0.0016657114, 0.122950554, -0.00989592075, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o22.Part0 = mas
- o22.Part1 = mas
- o22.CurrentAngle = -0.0043710088357329
- o23.Name = "Damage Script"
- o23.Parent = mas
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function onTouched(hit)
- local human = hit.Parent:findFirstChild("Humanoid")
- if (human ~= nil) then
- human.Health = human.Health - 20 -- Change the amount to change the damage.
- end
- end
- script.Parent.Touched:connect(onTouched)
- end,o23)
- end))
- o24.Parent = o23
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.Disabled = true
- wait(20)
- script.Parent.Disabled = false
- wait(5)
- end
- end,o24)
- end))
- o29.Name = "OriginalSize"
- o29.Parent = mas
- o29.Value = Vector3.new(1.00027585, 1.48964536, 1.00032866)
- o30.Name = "LeftKnee"
- o30.Parent = mas
- o30.C0 = CFrame.new(-0.00382620096, -0.264486194, 0.000586740673, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o30.C1 = CFrame.new(-0.00382620096, 0.289868593, 0.00030554086, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o30.Part0 = mas
- o30.Part1 = mas
- o30.CurrentAngle = 3.7316322476499e-08
- o35.Name = "LeftShoulder"
- o35.Parent = mas
- o35.C0 = CFrame.new(-1.24955308, 0.556408584, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o35.C1 = CFrame.new(0.247964978, 0.456732988, -0.00943991542, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o35.Part0 = mas
- o35.Part1 = mas
- o35.CurrentAngle = -0.4555284678936
- o36.Name = "OriginalSize"
- o36.Parent = mas
- o36.Value = Vector3.new(1.00027633, 1.39554, 1.00025082)
- o40.Name = "OriginalSize"
- o40.Parent = mas
- o40.Value = Vector3.new(1.00027561, 1.5362649, 1.00092912)
- o41.Name = "LeftHip"
- o41.Parent = mas
- o41.C0 = CFrame.new(-0.50451982, -0.243062243, 0.00122789107, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o41.C1 = CFrame.new(-0.00382620096, 0.4851138, 0.000686740503, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o41.Part0 = mas
- o41.Part1 = mas
- o41.CurrentAngle = -0.38807913661003
- o50.Name = "Root"
- o50.Parent = mas
- o50.C1 = CFrame.new(0.000280171633, 0.133037761, -0.0142721087, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o50.Part0 = o166
- o50.Part1 = mas
- o50.CurrentAngle = 0.067971117794514
- o51.Name = "OriginalSize"
- o51.Parent = mas
- o51.Value = Vector3.new(2.00017595, 0.400037616, 1.00021255)
- o52.Name = "Read me"
- o52.Parent = o2
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- --| Help for R15 model Zombie |--
- --
- -- To edit the zombie's damage go to LeftLowerArm/RightLowerArm > Damage Script > human.Health = human.Health - 5
- -- Edit the number to whatever you'd like
- -- The player will recieve damage from the LeftLowerArm and RightLowerArm
- -- To edit the walkspeed go to Humanoid > Scroll to the bottom > Edit the number shown after WalkSpeed
- -- You can also edit max health and spawn health under Humanoid > game
- --
- -- Have fun!
- --
- -- ImFarAway
- end,o52)
- end))
- o55.Name = "OriginalSize"
- o55.Parent = mas
- o55.Value = Vector3.new(1.00063133, 0.335407376, 1.00020337)
- o56.Name = "RightAnkle"
- o56.Parent = mas
- o56.C0 = CFrame.new(0.00382620096, -0.710731506, 0.000283418223, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o56.C1 = CFrame.new(0.00901681185, 0.0318431854, 0.000155551359, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o56.Part0 = mas
- o56.Part1 = mas
- o56.CurrentAngle = -0.28917965292931
- o57.Name = "RightFoot Terrain Joint"
- o57.Parent = mas
- o57.Part1 = mas
- o58.Name = "RightFoot Terrain Joint"
- o58.Parent = mas
- o58.Part1 = mas
- o62.Name = "OriginalSize"
- o62.Parent = mas
- o62.Value = Vector3.new(0.999299049, 0.335255772, 1.00029743)
- o63.Name = "RightWrist"
- o63.Parent = mas
- o63.C0 = CFrame.new(0.00214457512, -0.682049513, -0.00989595056, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o63.C1 = CFrame.new(0.000865101814, 0.058106944, -0.0154390335, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o63.Part0 = mas
- o63.Part1 = mas
- o64.Name = "FireParticle"
- o64.Parent = mas
- o64.Rotation = NumberRange.new(100000,100000)
- o64.Size = NumberSequence.new(1.1731845140457,0.75,0.3846150636673,0)
- o64.Color = ColorSequence.new(Color3.new(1, 0.333333, 0),Color3.new(1, 0, 0))
- o64.Enabled = false
- o64.LightEmission = 0.75
- o64.Texture = "rbxasset://textures/particles/explosion01_implosion_main.dds"
- o64.ZOffset = 1
- o64.Acceleration = Vector3.new(0, 300, 0)
- o64.Lifetime = NumberRange.new(0.20000000298023,0.20000000298023)
- o64.Rate = 200
- o64.RotSpeed = NumberRange.new(1,1)
- o64.Speed = NumberRange.new(0,0)
- o65.Parent = o64
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.Enabled = false
- wait(20)
- script.Parent.Enabled = true
- wait(5)
- end
- end,o65)
- end))
- o69.Name = "OriginalSize"
- o69.Parent = mas
- o69.Value = Vector3.new(1.00027657, 1.26567209, 1.00025082)
- o70.Name = "Damage Script"
- o70.Parent = mas
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function onTouched(hit)
- local human = hit.Parent:findFirstChild("Humanoid")
- if (human ~= nil) then
- human.Health = human.Health - 5 -- Change the amount to change the damage.
- end
- end
- script.Parent.Touched:connect(onTouched)
- end,o70)
- end))
- o71.Name = "RightElbow"
- o71.Parent = mas
- o71.C0 = CFrame.new(0.00214397907, -0.263139546, -0.00944012403, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o71.C1 = CFrame.new(0.00214457512, 0.122950554, -0.00989595056, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o71.Part0 = mas
- o71.Part1 = mas
- o71.CurrentAngle = -0.008651458658278
- o72.Name = "Damage Script"
- o72.Parent = mas
- o72.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function onTouched(hit)
- local human = hit.Parent:findFirstChild("Humanoid")
- if (human ~= nil) then
- human.Health = human.Health - 20 -- Change the amount to change the damage.
- end
- end
- script.Parent.Touched:connect(onTouched)
- end,o72)
- end))
- o73.Parent = o72
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.Disabled = true
- wait(20)
- script.Parent.Disabled = false
- wait(5)
- end
- end,o73)
- end))
- o78.Name = "OriginalSize"
- o78.Parent = mas
- o78.Value = Vector3.new(1.00027585, 1.48964536, 1.00032854)
- o79.Name = "RightKnee"
- o79.Parent = mas
- o79.C0 = CFrame.new(0.00382620096, -0.265086174, 0.000426991843, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o79.C1 = CFrame.new(0.00382620096, 0.289268613, 0.000145851634, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o79.Part0 = mas
- o79.Part1 = mas
- o79.CurrentAngle = -6.3460618093814e-08
- o84.Name = "RightShoulder"
- o84.Parent = mas
- o84.C0 = CFrame.new(1.25031853, 0.5565539, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o84.C1 = CFrame.new(-0.24787569, 0.456878304, -0.00944012403, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o84.Part0 = mas
- o84.Part1 = mas
- o84.CurrentAngle = 0.84690576791763
- o85.Name = "OriginalSize"
- o85.Parent = mas
- o85.Value = Vector3.new(1.00027633, 1.39554, 1.00025082)
- o89.Name = "OriginalSize"
- o89.Parent = mas
- o89.Value = Vector3.new(1.00027561, 1.5362649, 1.00092912)
- o90.Name = "RightHip"
- o90.Parent = mas
- o90.C0 = CFrame.new(0.505080223, -0.243262246, 0.00102789141, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o90.C1 = CFrame.new(0.00382620096, 0.484913796, 0.000486815348, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o90.Part0 = mas
- o90.Part1 = mas
- o90.CurrentAngle = 0.35391557216644
- o91.Parent = o2
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local larm = script.Parent:FindFirstChild("HumanoidRootPart")
- local rarm = script.Parent:FindFirstChild("HumanoidRootPart")
- function findNearestTorso(pos)
- local list = game.Workspace:children()
- local torso = nil
- local dist = 10000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("HumanoidRootPart")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- while true do
- wait(math.random(1,5))
- local target = findNearestTorso(script.Parent.HumanoidRootPart.Position)
- if target ~= nil then
- script.Parent.Humanoid:MoveTo(target.Position, target)
- end
- end
- end,o91)
- end))
- o92.Parent = o2
- o92.Torso = o166
- o92.WalkToPart = mas
- o92.Health = 10000
- o92.MaxHealth = 10000
- o92.WalkSpeed = 13
- o94.Parent = o92
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.WalkSpeed = 13
- wait(20)
- script.Parent.WalkSpeed = 20
- wait(5)
- end
- end,o94)
- end))
- o104.Name = "Waist"
- o104.Parent = mas
- o104.C0 = CFrame.new(0.000280171633, 0.537143946, -0.0142721087, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o104.C1 = CFrame.new(0.000338107347, -0.463463932, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o104.Part0 = mas
- o104.Part1 = mas
- o104.CurrentAngle = -0.10320875048637
- o105.Name = "OriginalSize"
- o105.Parent = mas
- o105.Value = Vector3.new(2.00029206, 1.60093355, 1.0005368)
- o106.Name = "Darkness"
- o106.Parent = mas
- o106.Transparency = NumberSequence.new(1,0.98000001907349,0.96791446208954,0.97326201200485,0.98000001907349,1)
- o106.Rotation = NumberRange.new(-100,100)
- o106.Size = NumberSequence.new(10,10)
- o106.Color = ColorSequence.new(Color3.new(0.831373, 0.454902, 0.0196078),Color3.new(0.831373, 0.454902, 0.0196078))
- o106.LightEmission = 0.5
- o106.Texture = "rbxassetid://75202463"
- o106.ZOffset = 1
- o106.Rate = 3
- o106.Speed = NumberRange.new(0,0)
- o107.Name = "Animate"
- o107.Parent = o2
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(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
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- 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 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)
- -- setup emote chat hook
- script.msg.Changed:connect(function(msg)
- script.msg.Value = ""
- local emote = ""
- if (string.sub(msg, 1, 3) == "/e ") then
- emote = string.sub(msg, 4)
- elseif (string.sub(msg, 1, 7) == "/emote ") then
- emote = string.sub(msg, 8)
- end
- if (pose == "Standing" and emoteNames[emote] ~= nil) then
- playAnimation(emote, 0.1, Humanoid)
- end
- -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
- end)
- -- 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,o107)
- end))
- o108.Name = "cheer"
- o108.Parent = o107
- o109.Name = "CheerAnim"
- o109.Parent = o108
- o109.AnimationId = "http://www.roblox.com/asset/?id=507770677"
- o110.Name = "climb"
- o110.Parent = o107
- o111.Name = "ClimbAnim"
- o111.Parent = o110
- o111.AnimationId = "http://www.roblox.com/asset/?id=1083182000"
- o112.Name = "dance"
- o112.Parent = o107
- o113.Name = "Animation1"
- o113.Parent = o112
- o113.AnimationId = "http://www.roblox.com/asset/?id=507771019"
- o114.Name = "Weight"
- o114.Parent = o113
- o114.Value = 10
- o115.Name = "Animation2"
- o115.Parent = o112
- o115.AnimationId = "http://www.roblox.com/asset/?id=507771955"
- o116.Name = "Weight"
- o116.Parent = o115
- o116.Value = 10
- o117.Name = "Animation3"
- o117.Parent = o112
- o117.AnimationId = "http://www.roblox.com/asset/?id=507772104"
- o118.Name = "Weight"
- o118.Parent = o117
- o118.Value = 10
- o119.Name = "dance2"
- o119.Parent = o107
- o120.Name = "Animation1"
- o120.Parent = o119
- o120.AnimationId = "http://www.roblox.com/asset/?id=507776043"
- o121.Name = "Weight"
- o121.Parent = o120
- o121.Value = 10
- o122.Name = "Animation2"
- o122.Parent = o119
- o122.AnimationId = "http://www.roblox.com/asset/?id=507776720"
- o123.Name = "Weight"
- o123.Parent = o122
- o123.Value = 10
- o124.Name = "Animation3"
- o124.Parent = o119
- o124.AnimationId = "http://www.roblox.com/asset/?id=507776879"
- o125.Name = "Weight"
- o125.Parent = o124
- o125.Value = 10
- o126.Name = "dance3"
- o126.Parent = o107
- o127.Name = "Animation1"
- o127.Parent = o126
- o127.AnimationId = "http://www.roblox.com/asset/?id=507777268"
- o128.Name = "Weight"
- o128.Parent = o127
- o128.Value = 10
- o129.Name = "Animation2"
- o129.Parent = o126
- o129.AnimationId = "http://www.roblox.com/asset/?id=507777451"
- o130.Name = "Weight"
- o130.Parent = o129
- o130.Value = 10
- o131.Name = "Animation3"
- o131.Parent = o126
- o131.AnimationId = "http://www.roblox.com/asset/?id=507777623"
- o132.Name = "Weight"
- o132.Parent = o131
- o132.Value = 10
- o133.Name = "fall"
- o133.Parent = o107
- o134.Name = "FallAnim"
- o134.Parent = o133
- o134.AnimationId = "http://www.roblox.com/asset/?id=1083189019"
- o135.Name = "idle"
- o135.Parent = o107
- o136.Name = "Animation1"
- o136.Parent = o135
- o136.AnimationId = "http://www.roblox.com/asset/?id=1083195517"
- o137.Name = "Weight"
- o137.Parent = o136
- o137.Value = 9
- o138.Name = "Animation2"
- o138.Parent = o135
- o138.AnimationId = "http://www.roblox.com/asset/?id=1083214717"
- o139.Name = "Weight"
- o139.Parent = o138
- o139.Value = 1
- o140.Name = "CheerAnim"
- o140.Parent = o135
- o140.AnimationId = "http://www.roblox.com/asset/?id=507770677"
- o141.Name = "Weight"
- o141.Parent = o140
- o141.Value = 1
- o142.Name = "jump"
- o142.Parent = o107
- o143.Name = "!ID!"
- o143.Parent = o142
- o143.AnimationId = "http://www.roblox.com/asset/?id=1083218792"
- o144.Name = "laugh"
- o144.Parent = o107
- o145.Name = "LaughAnim"
- o145.Parent = o144
- o145.AnimationId = "http://www.roblox.com/asset/?id=507770818"
- o146.Name = "point"
- o146.Parent = o107
- o147.Name = "PointAnim"
- o147.Parent = o146
- o147.AnimationId = "http://www.roblox.com/asset/?id=507770453"
- o148.Name = "run"
- o148.Parent = o107
- o149.Name = "RunAnim"
- o149.Parent = o148
- o149.AnimationId = "http://www.roblox.com/asset/?id=1083216690"
- o150.Name = "sit"
- o150.Parent = o107
- o151.Name = "SitAnim"
- o151.Parent = o150
- o151.AnimationId = "http://www.roblox.com/asset/?id=507768133"
- o152.Name = "swim"
- o152.Parent = o107
- o153.Name = "Swim"
- o153.Parent = o152
- o153.AnimationId = "http://www.roblox.com/asset/?id=1083222527"
- o154.Name = "swimidle"
- o154.Parent = o107
- o155.Name = "SwimIdle"
- o155.Parent = o154
- o155.AnimationId = "http://www.roblox.com/asset/?id=1083225406"
- o156.Name = "toollunge"
- o156.Parent = o107
- o157.Name = "ToolLungeAnim"
- o157.Parent = o156
- o157.AnimationId = "http://www.roblox.com/asset/?id=507768375"
- o158.Name = "toolnone"
- o158.Parent = o107
- o159.Name = "ToolNoneAnim"
- o159.Parent = o158
- o159.AnimationId = "http://www.roblox.com/asset/?id=507768375"
- o160.Name = "toolslash"
- o160.Parent = o107
- o161.Name = "ToolSlashAnim"
- o161.Parent = o160
- o161.AnimationId = "http://www.roblox.com/asset/?id=507768375"
- o162.Name = "walk"
- o162.Parent = o107
- o163.Name = "WalkAnim"
- o163.Parent = o162
- o163.AnimationId = "http://www.roblox.com/asset/?id=1083178339"
- o164.Name = "wave"
- o164.Parent = o107
- o165.Name = "WaveAnim"
- o165.Parent = o164
- o165.AnimationId = "http://www.roblox.com/asset/?id=507770239"
- o166.Name = "HumanoidRootPart"
- o166.Parent = o2
- o166.Material = Enum.Material.Metal
- o166.BrickColor = BrickColor.new("Black")
- o166.Transparency = 1
- o166.Position = Vector3.new(50.9547386, 2.3499999, 11.0416451)
- o166.Rotation = Vector3.new(-180, -62.2999992, -180)
- o166.CanCollide = false
- o166.Size = Vector3.new(2, 2, 1)
- o166.CFrame = CFrame.new(50.9547386, 2.3499999, 11.0416451, -0.464846224, 1.33575337e-08, -0.885391414, 7.72393705e-09, 1, 1.1031382e-08, 0.885391414, -1.71081116e-09, -0.464846224)
- o166.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o166.Position = Vector3.new(50.9547386, 2.3499999, 11.0416451)
- o168.Name = "OriginalSize"
- o168.Parent = o166
- o168.Value = Vector3.new(2, 2, 1)
- o169.Name = "Head"
- o169.Parent = o2
- o169.Material = Enum.Material.Metal
- o169.BrickColor = BrickColor.new("Black")
- o169.Transparency = 0.99000000953674
- o169.Position = Vector3.new(50.9245872, 4.01740217, 11.3232861)
- o169.Rotation = Vector3.new(-162.479996, -60.0099983, -164.23999)
- o169.FormFactor = Enum.FormFactor.Custom
- o169.Size = Vector3.new(1, 1, 1)
- o169.CFrame = CFrame.new(50.9245872, 4.01740217, 11.3232861, -0.481100708, 0.135804176, -0.866082728, 0.00810051523, 0.988575101, 0.150511637, 0.876627862, 0.0653955266, -0.47670424)
- o169.BottomSurface = Enum.SurfaceType.Smooth
- o169.TopSurface = Enum.SurfaceType.Smooth
- o169.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o169.Position = Vector3.new(50.9245872, 4.01740217, 11.3232861)
- o170.Parent = o169
- o170.MeshId = "http://www.roblox.com/asset?id=419776358"
- o170.MeshType = Enum.MeshType.FileMesh
- o177.Name = "Neck"
- o177.Parent = o169
- o177.C0 = CFrame.new(0.000338107347, 0.806032121, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o177.C1 = CFrame.new(-2.72095203e-05, -0.565615535, 0.00386685133, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o177.Part0 = mas
- o177.Part1 = o169
- o177.CurrentAngle = 0.036354959011078
- o178.Name = "OriginalSize"
- o178.Parent = o169
- o178.Value = Vector3.new(1, 1, 1)
- o179.Name = "GettingUp"
- o179.Parent = o169
- o179.Archivable = false
- o179.SoundId = "rbxasset://sounds/action_get_up.mp3"
- o179.Volume = 0.64999997615814
- o180.Name = "Died"
- o180.Parent = o169
- o180.Archivable = false
- o180.SoundId = "rbxasset://sounds/uuhhh.mp3"
- o180.Volume = 0.64999997615814
- o181.Name = "FreeFalling"
- o181.Parent = o169
- o181.Archivable = false
- o181.SoundId = "rbxasset://sounds/action_falling.mp3"
- o181.Volume = 0.64999997615814
- o181.Looped = true
- o182.Name = "Jumping"
- o182.Parent = o169
- o182.Archivable = false
- o182.SoundId = "rbxasset://sounds/action_jump.mp3"
- o182.Volume = 0.64999997615814
- o183.Name = "Landing"
- o183.Parent = o169
- o183.Archivable = false
- o183.SoundId = "rbxasset://sounds/action_jump_land.mp3"
- o183.Volume = 0.64999997615814
- o184.Name = "Splash"
- o184.Parent = o169
- o184.Archivable = false
- o184.SoundId = "rbxasset://sounds/impact_water.mp3"
- o184.Volume = 0.64999997615814
- o185.Name = "Running"
- o185.Parent = o169
- o185.Archivable = false
- o185.Pitch = 1.8500000238419
- o185.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
- o185.Volume = 0.64999997615814
- o185.Looped = true
- o186.Name = "Swimming"
- o186.Parent = o169
- o186.Archivable = false
- o186.Pitch = 1.6000000238419
- o186.SoundId = "rbxasset://sounds/action_swim.mp3"
- o186.Volume = 0.64999997615814
- o186.Looped = true
- o187.Name = "Climbing"
- o187.Parent = o169
- o187.Archivable = false
- o187.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
- o187.Volume = 0.64999997615814
- o187.Looped = true
- o188.Name = "Sound"
- o188.Parent = o2
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(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,o188)
- end))
- o189.Name = "LocalSound"
- o189.Parent = o188
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(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
- }
- -- 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,o189)
- end))
- o190.Parent = o2
- o191.Parent = o190
- o191.Material = Enum.Material.Metal
- o191.BrickColor = BrickColor.new("Black")
- o191.Reflectance = 0.5
- o191.Transparency = 1
- o191.Position = Vector3.new(46.342205, 4.8114872, 10.7486134)
- o191.Rotation = Vector3.new(64.9300003, -69.2999954, -27.4499989)
- o191.RotVelocity = Vector3.new(0, -3.44673824, 0)
- o191.Velocity = Vector3.new(-13.9093094, 0, -8.4333725)
- o191.CanCollide = false
- o191.Size = Vector3.new(0.200000003, 1.45000005, 2)
- o191.CFrame = CFrame.new(46.342205, 4.8114872, 10.7486134, 0.313750237, 0.162966117, -0.935415685, -0.947220802, -0.0145814847, -0.320250273, -0.0658297092, 0.986523807, 0.149790004)
- o191.LeftSurface = Enum.SurfaceType.Weld
- o191.RightSurface = Enum.SurfaceType.Weld
- o191.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o191.Position = Vector3.new(46.342205, 4.8114872, 10.7486134)
- o191.Velocity = Vector3.new(-13.9093094, 0, -8.4333725)
- o192.Parent = o190
- o192.Material = Enum.Material.Metal
- o192.BrickColor = BrickColor.new("Black")
- o192.Reflectance = 0.5
- o192.Transparency = 1
- o192.Position = Vector3.new(46.4033508, 4.62152767, 10.7357206)
- o192.Rotation = Vector3.new(64.9300003, -69.2999954, -27.4499989)
- o192.RotVelocity = Vector3.new(0, -3.44673824, 0)
- o192.Velocity = Vector3.new(-13.864872, 0, -8.22261906)
- o192.CanCollide = false
- o192.Size = Vector3.new(0.200000003, 1.45000005, 2)
- o192.CFrame = CFrame.new(46.4033508, 4.62152767, 10.7357206, 0.313746721, 0.16296795, -0.93541652, -0.947221994, -0.0145806419, -0.320246696, -0.0658289418, 0.986523509, 0.149792254)
- o192.LeftSurface = Enum.SurfaceType.Weld
- o192.RightSurface = Enum.SurfaceType.Weld
- o192.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o192.Position = Vector3.new(46.4033508, 4.62152767, 10.7357206)
- o192.Velocity = Vector3.new(-13.864872, 0, -8.22261906)
- o194.Name = "FireParticle"
- o194.Parent = mas
- o194.Rotation = NumberRange.new(100000,100000)
- o194.Size = NumberSequence.new(1.1731845140457,0.75,0.3846150636673,0)
- o194.Color = ColorSequence.new(Color3.new(1, 0.333333, 0),Color3.new(1, 0, 0))
- o194.Enabled = false
- o194.LightEmission = 0.75
- o194.Texture = "rbxasset://textures/particles/explosion01_implosion_main.dds"
- o194.ZOffset = 1
- o194.Acceleration = Vector3.new(0, 300, 0)
- o194.Lifetime = NumberRange.new(0.20000000298023,0.20000000298023)
- o194.Rate = 200
- o194.RotSpeed = NumberRange.new(1,1)
- o194.Speed = NumberRange.new(0,0)
- o195.Parent = o194
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- script.Parent.Enabled = false
- wait(20)
- script.Parent.Enabled = true
- wait(5)
- end
- end,o195)
- end))
- o197.Parent = o190
- o197.Material = Enum.Material.Metal
- o197.BrickColor = BrickColor.new("Black")
- o197.Reflectance = 0.5
- o197.Position = Vector3.new(44.6981812, 3.60448694, 9.68939018)
- o197.Rotation = Vector3.new(102.610001, -54.4599991, 108.5)
- o197.RotVelocity = Vector3.new(0, -0.667089462, 0)
- o197.Velocity = Vector3.new(-12.5376873, 0, -3.53663993)
- o197.CanCollide = false
- o197.Size = Vector3.new(0.200000003, 0.300000012, 0.200000003)
- o197.CFrame = CFrame.new(44.6981812, 3.60448694, 9.68939018, -0.184472263, -0.551199853, -0.813724995, 0.045024924, 0.822325706, -0.567232966, 0.981805623, -0.141276628, -0.126878545)
- o197.BottomSurface = Enum.SurfaceType.Weld
- o197.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o197.Position = Vector3.new(44.6981812, 3.60448694, 9.68939018)
- o197.Velocity = Vector3.new(-12.5376873, 0, -3.53663993)
- o200.Name = "Union-to-Union Strong Joint"
- o200.Parent = mas
- o200.C0 = CFrame.new(-0.626907349, -0.670824051, 0.450000644, 0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994)
- o200.C1 = CFrame.new(-0.109256744, -0.39245224, -1.15927124, 2.32706032e-08, 1, 6.52119212e-08, 1.05119796e-07, -6.52119212e-08, 1, 1, -2.32705961e-08, -1.05119796e-07)
- o200.Part0 = mas
- o200.Part1 = mas
- mas.Parent = workspace
- mas:MakeJoints()
- local mas1 = mas:GetChildren()
- for i=1,#mas1 do
- mas1[i].Parent = workspace
- ypcall(function() mas1[i]:MakeJoints() end)
- end
- mas:Destroy()
- for i=1,#cors do
- coroutine.resume(cors[i])
- end
Advertisement
Add Comment
Please, Sign In to add comment