Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Created with ttyyuu12345's compiler
- --Errors: ModuleScript
- Create = function(itemClass,tabl)
- local item = Instance.new(itemClass)
- for i,v in pairs(tabl) do
- local a,b = ypcall(function() return item[i] end)
- if a then
- item[i] = tabl[i]
- end
- end
- return item
- end
- function runDummyScript(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 = Create("Model",{
- ["Name"] = "Drooling Zombie",
- ["Parent"] = mas,
- })
- o2 = Create("Part",{
- ["Name"] = "HumanoidRootPart",
- ["Parent"] = o1,
- ["Material"] = Enum.Material.WoodPlanks,
- ["BrickColor"] = BrickColor.new("Earth green"),
- ["Transparency"] = 1,
- ["Position"] = Vector3.new(-28.1000671, 3.00001097, -29.1999817),
- ["Rotation"] = Vector3.new(-2.70580359e-020, -90, 0),
- ["CFrame"] = CFrame.new(-28.1000671, 3.00001097, -29.1999817, 4.49431016e-021, -6.79974523e-022, -1, 4.72251821e-022, 1, -6.79974523e-022, 1, -4.72251821e-022, 4.49431016e-021),
- ["FormFactor"] = Enum.FormFactor.Symmetric,
- ["Size"] = Vector3.new(2, 2, 1),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- ["Color"] = Color3.new(0.152941, 0.27451, 0.176471),
- })
- o3 = Create("Motor6D",{
- ["Name"] = "Root Hip",
- ["Parent"] = o2,
- ["Part0"] = o2,
- ["Part1"] = o4,
- ["MaxVelocity"] = 0.10000000149012,
- })
- o4 = Create("Part",{
- ["Name"] = "Torso",
- ["Parent"] = o1,
- ["Material"] = Enum.Material.WoodPlanks,
- ["BrickColor"] = BrickColor.new("Earth green"),
- ["Position"] = Vector3.new(-28.1000671, 3.00001097, -29.1999817),
- ["Rotation"] = Vector3.new(-2.70580359e-020, -90, 0),
- ["CFrame"] = CFrame.new(-28.1000671, 3.00001097, -29.1999817, 4.49431016e-021, -6.79974523e-022, -1, 4.72251821e-022, 1, -6.79974523e-022, 1, -4.72251821e-022, 4.49431016e-021),
- ["FormFactor"] = Enum.FormFactor.Symmetric,
- ["Size"] = Vector3.new(2, 2, 1),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- ["Color"] = Color3.new(0.152941, 0.27451, 0.176471),
- })
- o5 = Create("Motor6D",{
- ["Name"] = "Left Hip",
- ["Parent"] = o4,
- ["Part0"] = o4,
- ["Part1"] = o11,
- ["MaxVelocity"] = 0.10000000149012,
- })
- o6 = Create("Motor6D",{
- ["Name"] = "Right Hip",
- ["Parent"] = o4,
- ["Part0"] = o4,
- ["Part1"] = o12,
- ["MaxVelocity"] = 0.10000000149012,
- })
- o7 = Create("Motor6D",{
- ["Name"] = "Left Shoulder",
- ["Parent"] = o4,
- ["Part0"] = o4,
- ["Part1"] = o13,
- ["MaxVelocity"] = 0.10000000149012,
- })
- o8 = Create("Motor6D",{
- ["Name"] = "Right Shoulder",
- ["Parent"] = o4,
- ["Part0"] = o4,
- ["Part1"] = o14,
- ["MaxVelocity"] = 0.10000000149012,
- })
- o9 = Create("Motor6D",{
- ["Name"] = "Neck",
- ["Parent"] = o4,
- ["Part0"] = o4,
- ["Part1"] = o15,
- ["MaxVelocity"] = 0.10000000149012,
- })
- o10 = Create("BodyForce",{
- ["Name"] = "RepulsionForce",
- ["Parent"] = o4,
- ["force"] = Vector3.new(0, 0, 0),
- })
- o11 = Create("Part",{
- ["Name"] = "Left Leg",
- ["Parent"] = o1,
- ["Material"] = Enum.Material.WoodPlanks,
- ["BrickColor"] = BrickColor.new("Earth green"),
- ["Position"] = Vector3.new(-28.1000671, 1.00001109, -29.6999817),
- ["Rotation"] = Vector3.new(-2.70580391e-020, -90, 0),
- ["CFrame"] = CFrame.new(-28.1000671, 1.00001109, -29.6999817, 4.49431016e-021, -6.79974422e-022, -1, 4.72251821e-022, 0.999999881, -6.79974523e-022, 1, -4.7225177e-022, 4.49431016e-021),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Symmetric,
- ["Size"] = Vector3.new(1, 2, 1),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- ["Color"] = Color3.new(0.152941, 0.27451, 0.176471),
- })
- o12 = Create("Part",{
- ["Name"] = "Right Leg",
- ["Parent"] = o1,
- ["Material"] = Enum.Material.WoodPlanks,
- ["BrickColor"] = BrickColor.new("Earth green"),
- ["Position"] = Vector3.new(-28.1000671, 1.00001109, -28.6999817),
- ["Rotation"] = Vector3.new(-2.70580391e-020, -90, 0),
- ["CFrame"] = CFrame.new(-28.1000671, 1.00001109, -28.6999817, 4.49431016e-021, -6.79974422e-022, -1, 4.72251821e-022, 0.999999881, -6.79974523e-022, 1, -4.7225177e-022, 4.49431016e-021),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Symmetric,
- ["Size"] = Vector3.new(1, 2, 1),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- ["Color"] = Color3.new(0.152941, 0.27451, 0.176471),
- })
- o13 = Create("Part",{
- ["Name"] = "Left Arm",
- ["Parent"] = o1,
- ["Material"] = Enum.Material.WoodPlanks,
- ["BrickColor"] = BrickColor.new("Earth green"),
- ["Position"] = Vector3.new(-28.1000671, 3.00001097, -30.6999817),
- ["Rotation"] = Vector3.new(-2.70580391e-020, -90, 0),
- ["CFrame"] = CFrame.new(-28.1000671, 3.00001097, -30.6999817, 4.49431016e-021, -6.79974422e-022, -1, 4.72251821e-022, 0.999999881, -6.79974523e-022, 1, -4.7225177e-022, 4.49431016e-021),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Symmetric,
- ["Size"] = Vector3.new(1, 2, 1),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- ["Color"] = Color3.new(0.152941, 0.27451, 0.176471),
- })
- o14 = Create("Part",{
- ["Name"] = "Right Arm",
- ["Parent"] = o1,
- ["Material"] = Enum.Material.WoodPlanks,
- ["BrickColor"] = BrickColor.new("Earth green"),
- ["Position"] = Vector3.new(-28.1000671, 3.00001097, -27.6999817),
- ["Rotation"] = Vector3.new(-2.70580391e-020, -90, 0),
- ["CFrame"] = CFrame.new(-28.1000671, 3.00001097, -27.6999817, 4.49431016e-021, -6.79974422e-022, -1, 4.72251821e-022, 0.999999881, -6.79974523e-022, 1, -4.7225177e-022, 4.49431016e-021),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Symmetric,
- ["Size"] = Vector3.new(1, 2, 1),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- ["Color"] = Color3.new(0.152941, 0.27451, 0.176471),
- })
- o15 = Create("Part",{
- ["Name"] = "Head",
- ["Parent"] = o1,
- ["Material"] = Enum.Material.WoodPlanks,
- ["BrickColor"] = BrickColor.new("Camo"),
- ["Position"] = Vector3.new(-28.1000671, 4.50001097, -29.1999817),
- ["Rotation"] = Vector3.new(-2.70580359e-020, -90, 0),
- ["CFrame"] = CFrame.new(-28.1000671, 4.50001097, -29.1999817, 4.49431016e-021, -6.79974523e-022, -1, 4.72251821e-022, 1, -6.79974523e-022, 1, -4.72251821e-022, 4.49431016e-021),
- ["FormFactor"] = Enum.FormFactor.Symmetric,
- ["Size"] = Vector3.new(2, 1, 1),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- ["Color"] = Color3.new(0.227451, 0.490196, 0.0823529),
- })
- o16 = Create("Decal",{
- ["Name"] = "Face",
- ["Parent"] = o15,
- ["Texture"] = "http://www.roblox.com/asset/?id=7074882",
- })
- o17 = Create("SpecialMesh",{
- ["Parent"] = o15,
- ["Scale"] = Vector3.new(1.25, 1.25, 1.25),
- })
- o18 = Create("Humanoid",{
- ["Parent"] = o1,
- ["NameOcclusion"] = Enum.NameOcclusion.OccludeAll,
- ["RightLeg"] = o12,
- ["LeftLeg"] = o11,
- ["Torso"] = o2,
- ["WalkSpeed"] = 10,
- })
- o19 = Create("Script",{
- ["Name"] = "Animate",
- ["Parent"] = o1,
- })
- 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 Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=125750544", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=125750618", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=125749145", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=125750759", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=125750800", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=125750867", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance = {
- { id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", 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.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- 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 = ""
- 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 = stopAllAnimations()
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil)
- if (animName ~= currentAnim and not idleFromEmote) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- 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
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- -- 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 currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopToolAnimations()
- playToolAnimation(repeatAnim, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- if (animName ~= toolAnimName) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- 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
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- playAnimation("walk", 0.1, Humanoid)
- 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)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- 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>0 then
- pose = "Running"
- else
- 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
- stopAllAnimations()
- moveSit()
- 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
- -- print("Wha " .. pose)
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- 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"
- 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");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end,o19)
- end))
- o20 = Create("StringValue",{
- ["Name"] = "climb",
- ["Parent"] = o19,
- })
- o21 = Create("Animation",{
- ["Name"] = "ClimbAnim",
- ["Parent"] = o20,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125750800",
- })
- o22 = Create("StringValue",{
- ["Name"] = "fall",
- ["Parent"] = o19,
- })
- o23 = Create("Animation",{
- ["Name"] = "FallAnim",
- ["Parent"] = o22,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125750759",
- })
- o24 = Create("StringValue",{
- ["Name"] = "idle",
- ["Parent"] = o19,
- })
- o25 = Create("Animation",{
- ["Name"] = "Animation1",
- ["Parent"] = o24,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125750544",
- })
- o26 = Create("NumberValue",{
- ["Name"] = "Weight",
- ["Parent"] = o25,
- ["Value"] = 9,
- })
- o27 = Create("Animation",{
- ["Name"] = "Animation2",
- ["Parent"] = o24,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125750618",
- })
- o28 = Create("NumberValue",{
- ["Name"] = "Weight",
- ["Parent"] = o27,
- ["Value"] = 1,
- })
- o29 = Create("StringValue",{
- ["Name"] = "jump",
- ["Parent"] = o19,
- })
- o30 = Create("Animation",{
- ["Name"] = "JumpAnim",
- ["Parent"] = o29,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125750702",
- })
- o31 = Create("StringValue",{
- ["Name"] = "run",
- ["Parent"] = o19,
- })
- o32 = Create("Animation",{
- ["Name"] = "RunAnim",
- ["Parent"] = o31,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125749145",
- })
- o33 = Create("StringValue",{
- ["Name"] = "toolnone",
- ["Parent"] = o19,
- })
- o34 = Create("Animation",{
- ["Name"] = "ToolNoneAnim",
- ["Parent"] = o33,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125750867",
- })
- o35 = Create("StringValue",{
- ["Name"] = "walk",
- ["Parent"] = o19,
- })
- o36 = Create("Animation",{
- ["Name"] = "WalkAnim",
- ["Parent"] = o35,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=125749145",
- })
- o37 = Create("Script",{
- ["Parent"] = o1,
- })
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local zombie = script.Parent
- for _, script in pairs(zombie.ModuleScripts:GetChildren()) do
- if not game.ServerStorage:FindFirstChild(script.Name) then
- script:Clone().Parent = game.ServerStorage
- end
- end
- local AI = require(game.ServerStorage.ROBLOX_ZombieAI).new(zombie)
- local DestroyService = require(game.ServerStorage.ROBLOX_DestroyService)
- local function clearParts(parent)
- for _, part in pairs(parent:GetChildren()) do
- clearParts(part)
- end
- local delay
- if parent:IsA("Part") then
- delay = math.random(5,10)
- else
- delay = 11
- end
- DestroyService:AddItem(parent, delay)
- end
- zombie.Humanoid.Died:connect(function()
- AI.Stop()
- math.randomseed(tick())
- clearParts(zombie)
- script.Disabled = true
- end)
- local lastMoan = os.time()
- math.randomseed(os.time())
- while true do
- local animationTrack = zombie.Humanoid:LoadAnimation(zombie.Animations.Arms)
- animationTrack:Play()
- -- local now = os.time()
- -- if now - lastMoan > 5 then
- -- if math.random() > .3 then
- -- zombie.Moan:Play()
- ---- print("playing moan")
- -- lastMoan = now
- -- end
- -- end
- wait(2)
- end
- end,o37)
- end))
- o38 = Create("BillboardGui",{
- ["Parent"] = o1,
- ["Size"] = UDim2.new(0,100,0,30),
- ["StudsOffset"] = Vector3.new(0, 5, 0),
- })
- o39 = Create("TextLabel",{
- ["Parent"] = o38,
- ["Size"] = UDim2.new(1,0,1,0),
- ["Text"] = "Idle",
- ["Visible"] = false,
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["Font"] = Enum.Font.SourceSansBold,
- ["FontSize"] = Enum.FontSize.Size24,
- })
- o40 = Create("Configuration",{
- ["Name"] = "ModuleScripts",
- ["Parent"] = o1,
- })
- o47 = Create("Configuration",{
- ["Name"] = "Configurations",
- ["Parent"] = o1,
- })
- o48 = Create("IntValue",{
- ["Name"] = "Damage",
- ["Parent"] = o47,
- ["Value"] = 30,
- })
- o49 = Create("BoolValue",{
- ["Name"] = "Debug",
- ["Parent"] = o47,
- })
- o50 = Create("IntValue",{
- ["Name"] = "FieldOfView",
- ["Parent"] = o47,
- ["Value"] = 180,
- })
- o51 = Create("IntValue",{
- ["Name"] = "AggroRange",
- ["Parent"] = o47,
- ["Value"] = 200,
- })
- o52 = Create("Configuration",{
- ["Name"] = "Animations",
- ["Parent"] = o1,
- })
- o53 = Create("Animation",{
- ["Name"] = "Attack",
- ["Parent"] = o52,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=180416148",
- })
- o54 = Create("Animation",{
- ["Name"] = "Arms",
- ["Parent"] = o52,
- ["AnimationId"] = "http://www.roblox.com/asset/?id=183294396",
- })
- o55 = Create("CharacterMesh",{
- ["Name"] = "Zombie Left Arm",
- ["Parent"] = o1,
- ["MeshId"] = 37683097,
- ["BodyPart"] = Enum.BodyPart.LeftArm,
- ["OverlayTextureId"] = 37686282,
- })
- o56 = Create("CharacterMesh",{
- ["Name"] = "Zombie Left Leg",
- ["Parent"] = o1,
- ["MeshId"] = 37683150,
- ["BodyPart"] = Enum.BodyPart.LeftLeg,
- ["OverlayTextureId"] = 37687646,
- })
- o57 = Create("CharacterMesh",{
- ["Name"] = "Zombie Right Arm",
- ["Parent"] = o1,
- ["MeshId"] = 37683174,
- ["BodyPart"] = Enum.BodyPart.RightArm,
- ["OverlayTextureId"] = 37686282,
- })
- o58 = Create("CharacterMesh",{
- ["Name"] = "Zombie Right Leg",
- ["Parent"] = o1,
- ["MeshId"] = 37683227,
- ["BodyPart"] = Enum.BodyPart.RightLeg,
- ["OverlayTextureId"] = 37687646,
- })
- o59 = Create("CharacterMesh",{
- ["Name"] = "Zombie torso",
- ["Parent"] = o1,
- ["MeshId"] = 37683263,
- ["BodyPart"] = Enum.BodyPart.Torso,
- ["OverlayTextureId"] = 37686282,
- })
- o60 = Create("Sound",{
- ["Name"] = "Moan",
- ["Parent"] = o1,
- ["Pitch"] = 0.15000000596046,
- ["SoundId"] = "http://www.roblox.com/asset/?id=12222242",
- ["Volume"] = 0.050000000745058,
- })
- o61 = Create("BodyColors",{
- ["Parent"] = o1,
- ["HeadColor"] = BrickColor.new("Camo"),
- ["LeftArmColor"] = BrickColor.new("Earth green"),
- ["LeftLegColor"] = BrickColor.new("Earth green"),
- ["RightArmColor"] = BrickColor.new("Earth green"),
- ["RightLegColor"] = BrickColor.new("Earth green"),
- ["TorsoColor"] = BrickColor.new("Earth green"),
- })
- 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