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"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Motor6D2 = Instance.new("Motor6D")
- Part3 = Instance.new("Part")
- BodyForce4 = Instance.new("BodyForce")
- Motor6D5 = Instance.new("Motor6D")
- Motor6D6 = Instance.new("Motor6D")
- Motor6D7 = Instance.new("Motor6D")
- Motor6D8 = Instance.new("Motor6D")
- Motor6D9 = Instance.new("Motor6D")
- Part10 = Instance.new("Part")
- Part11 = Instance.new("Part")
- Part12 = Instance.new("Part")
- Part13 = Instance.new("Part")
- Weld14 = Instance.new("Weld")
- Part15 = Instance.new("Part")
- Decal16 = Instance.new("Decal")
- SpecialMesh17 = Instance.new("SpecialMesh")
- Humanoid18 = Instance.new("Humanoid")
- Script19 = Instance.new("Script")
- StringValue20 = Instance.new("StringValue")
- Animation21 = Instance.new("Animation")
- StringValue22 = Instance.new("StringValue")
- Animation23 = Instance.new("Animation")
- StringValue24 = Instance.new("StringValue")
- Animation25 = Instance.new("Animation")
- NumberValue26 = Instance.new("NumberValue")
- Animation27 = Instance.new("Animation")
- NumberValue28 = Instance.new("NumberValue")
- StringValue29 = Instance.new("StringValue")
- Animation30 = Instance.new("Animation")
- StringValue31 = Instance.new("StringValue")
- Animation32 = Instance.new("Animation")
- StringValue33 = Instance.new("StringValue")
- Animation34 = Instance.new("Animation")
- StringValue35 = Instance.new("StringValue")
- Animation36 = Instance.new("Animation")
- BillboardGui37 = Instance.new("BillboardGui")
- TextLabel38 = Instance.new("TextLabel")
- Sound39 = Instance.new("Sound")
- Tool40 = Instance.new("Tool")
- LocalScript41 = Instance.new("LocalScript")
- Script42 = Instance.new("Script")
- BodyVelocity43 = Instance.new("BodyVelocity")
- Part44 = Instance.new("Part")
- Sound45 = Instance.new("Sound")
- SpecialMesh46 = Instance.new("SpecialMesh")
- BoolValue47 = Instance.new("BoolValue")
- Sound48 = Instance.new("Sound")
- Script49 = Instance.new("Script")
- Model0.Name = "Darkness"
- Model0.Parent = mas
- Part1.Name = "HumanoidRootPart"
- Part1.Parent = Model0
- Part1.BrickColor = BrickColor.new("Earth green")
- Part1.Transparency = 1
- Part1.Rotation = Vector3.new(0, -90, 0)
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(2.75328374, 2.75328374, 1.37664187)
- Part1.CFrame = CFrame.new(-8.29670906, 4.1299367, -21.1356354, 4.49431016e-21, -6.79974523e-22, -1, 4.72251821e-22, 1, -6.79974523e-22, 1, -4.72251821e-22, 4.49431016e-21)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.152941, 0.27451, 0.176471)
- Part1.Position = Vector3.new(-8.29670906, 4.1299367, -21.1356354)
- Part1.Orientation = Vector3.new(0, -90, 0)
- Part1.Color = Color3.new(0.152941, 0.27451, 0.176471)
- Motor6D2.Name = "Root Hip"
- Motor6D2.Parent = Part1
- Motor6D2.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D2.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D2.Part0 = Part1
- Motor6D2.Part1 = Part3
- Motor6D2.MaxVelocity = 0.10000000149012
- Part3.Name = "Torso"
- Part3.Parent = Model0
- Part3.BrickColor = BrickColor.new("Smoky grey")
- Part3.Rotation = Vector3.new(0, -90, 0)
- Part3.FormFactor = Enum.FormFactor.Symmetric
- Part3.Size = Vector3.new(2.75328374, 2.75328374, 1.37664187)
- Part3.CFrame = CFrame.new(-8.29670906, 4.1299367, -21.1356354, 4.49431016e-21, -6.79974523e-22, -1, 4.72251821e-22, 1, -6.79974523e-22, 1, -4.72251821e-22, 4.49431016e-21)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.Color = Color3.new(0.356863, 0.364706, 0.411765)
- Part3.Position = Vector3.new(-8.29670906, 4.1299367, -21.1356354)
- Part3.Orientation = Vector3.new(0, -90, 0)
- Part3.Color = Color3.new(0.356863, 0.364706, 0.411765)
- BodyForce4.Name = "RepulsionForce"
- BodyForce4.Parent = Part3
- BodyForce4.force = Vector3.new(0, 0, 0)
- Motor6D5.Name = "Left Hip"
- Motor6D5.Parent = Part3
- Motor6D5.C0 = CFrame.new(-1.37664187, -1.37664187, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D5.C1 = CFrame.new(-0.688320935, 1.37664187, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D5.Part0 = Part3
- Motor6D5.Part1 = Part10
- Motor6D5.MaxVelocity = 0.10000000149012
- Motor6D6.Name = "Right Hip"
- Motor6D6.Parent = Part3
- Motor6D6.C0 = CFrame.new(1.37664187, -1.37664187, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D6.C1 = CFrame.new(0.688320935, 1.37664187, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D6.Part0 = Part3
- Motor6D6.Part1 = Part11
- Motor6D6.MaxVelocity = 0.10000000149012
- Motor6D7.Name = "Left Shoulder"
- Motor6D7.Parent = Part3
- Motor6D7.C0 = CFrame.new(-1.37664187, 0.688320935, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D7.C1 = CFrame.new(0.688320935, 0.688320935, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D7.Part0 = Part3
- Motor6D7.Part1 = Part12
- Motor6D7.MaxVelocity = 0.10000000149012
- Motor6D8.Name = "Right Shoulder"
- Motor6D8.Parent = Part3
- Motor6D8.C0 = CFrame.new(1.37664187, 0.688320935, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D8.C1 = CFrame.new(-0.688320935, 0.688320935, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D8.Part0 = Part3
- Motor6D8.Part1 = Part13
- Motor6D8.MaxVelocity = 0.10000000149012
- Motor6D9.Name = "Neck"
- Motor6D9.Parent = Part3
- Motor6D9.C0 = CFrame.new(0, 1.37664187, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D9.C1 = CFrame.new(0, -0.688320935, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D9.Part0 = Part3
- Motor6D9.Part1 = Part15
- Motor6D9.MaxVelocity = 0.10000000149012
- Part10.Name = "Left Leg"
- Part10.Parent = Model0
- Part10.BrickColor = BrickColor.new("Black")
- Part10.Rotation = Vector3.new(0, -90, 0)
- Part10.CanCollide = false
- Part10.FormFactor = Enum.FormFactor.Symmetric
- Part10.Size = Vector3.new(1.37664187, 2.75328374, 1.37664187)
- Part10.CFrame = CFrame.new(-8.29670906, 1.37665319, -21.8239555, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
- Part10.BottomSurface = Enum.SurfaceType.Smooth
- Part10.TopSurface = Enum.SurfaceType.Smooth
- Part10.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part10.Position = Vector3.new(-8.29670906, 1.37665319, -21.8239555)
- Part10.Orientation = Vector3.new(0, -90, 0)
- Part10.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part11.Name = "Right Leg"
- Part11.Parent = Model0
- Part11.BrickColor = BrickColor.new("Black")
- Part11.Rotation = Vector3.new(0, -90, 0)
- Part11.CanCollide = false
- Part11.FormFactor = Enum.FormFactor.Symmetric
- Part11.Size = Vector3.new(1.37664187, 2.75328374, 1.37664187)
- Part11.CFrame = CFrame.new(-8.29670906, 1.37665319, -20.4473152, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
- Part11.BottomSurface = Enum.SurfaceType.Smooth
- Part11.TopSurface = Enum.SurfaceType.Smooth
- Part11.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part11.Position = Vector3.new(-8.29670906, 1.37665319, -20.4473152)
- Part11.Orientation = Vector3.new(0, -90, 0)
- Part11.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part12.Name = "Left Arm"
- Part12.Parent = Model0
- Part12.BrickColor = BrickColor.new("Black")
- Part12.Rotation = Vector3.new(0, -90, 0)
- Part12.CanCollide = false
- Part12.FormFactor = Enum.FormFactor.Symmetric
- Part12.Size = Vector3.new(1.37664187, 2.75328374, 1.37664187)
- Part12.CFrame = CFrame.new(-8.29670906, 4.1299367, -23.2005978, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
- Part12.BottomSurface = Enum.SurfaceType.Smooth
- Part12.TopSurface = Enum.SurfaceType.Smooth
- Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part12.Position = Vector3.new(-8.29670906, 4.1299367, -23.2005978)
- Part12.Orientation = Vector3.new(0, -90, 0)
- Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part13.Name = "Right Arm"
- Part13.Parent = Model0
- Part13.BrickColor = BrickColor.new("Black")
- Part13.Rotation = Vector3.new(0, -90, 0)
- Part13.CanCollide = false
- Part13.FormFactor = Enum.FormFactor.Symmetric
- Part13.Size = Vector3.new(1.37664187, 2.75328374, 1.37664187)
- Part13.CFrame = CFrame.new(-8.29670906, 4.1299367, -19.070673, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.TopSurface = Enum.SurfaceType.Smooth
- Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part13.Position = Vector3.new(-8.29670906, 4.1299367, -19.070673)
- Part13.Orientation = Vector3.new(0, -90, 0)
- Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Weld14.Name = "RightGrip"
- Weld14.Parent = Part13
- Weld14.C0 = CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, -0)
- Weld14.C1 = CFrame.new(0, 0, -1, 0, 0, 1, 1, 0, 0, 0, 1, 0)
- Weld14.Part0 = Part13
- Weld14.Part1 = Part44
- Part15.Name = "Head"
- Part15.Parent = Model0
- Part15.BrickColor = BrickColor.new("Black")
- Part15.Rotation = Vector3.new(0, -90, 0)
- Part15.FormFactor = Enum.FormFactor.Symmetric
- Part15.Size = Vector3.new(2.75328374, 1.37664187, 1.37664187)
- Part15.CFrame = CFrame.new(-8.29670906, 6.19489956, -21.1356354, 4.49431016e-21, -6.79974523e-22, -1, 4.72251821e-22, 1, -6.79974523e-22, 1, -4.72251821e-22, 4.49431016e-21)
- Part15.BottomSurface = Enum.SurfaceType.Smooth
- Part15.TopSurface = Enum.SurfaceType.Smooth
- Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part15.Position = Vector3.new(-8.29670906, 6.19489956, -21.1356354)
- Part15.Orientation = Vector3.new(0, -90, 0)
- Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Decal16.Name = "Face"
- Decal16.Parent = Part15
- Decal16.Texture = "http://www.roblox.com/asset/?id=7074882"
- SpecialMesh17.Parent = Part15
- SpecialMesh17.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh17.Scale = Vector3.new(1.25, 1.25, 1.25)
- Humanoid18.Parent = Model0
- Humanoid18.RightLeg = Part11
- Humanoid18.LeftLeg = Part10
- Humanoid18.Torso = Part1
- Humanoid18.Health = 34353544
- Humanoid18.MaxHealth = 34353544
- Humanoid18.WalkSpeed = 5
- Script19.Name = "Animate"
- Script19.Parent = Model0
- table.insert(cors,sandbox(Script19,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))
- StringValue20.Name = "climb"
- StringValue20.Parent = Script19
- Animation21.Name = "ClimbAnim"
- Animation21.Parent = StringValue20
- Animation21.AnimationId = "http://www.roblox.com/asset/?id=125750800"
- StringValue22.Name = "fall"
- StringValue22.Parent = Script19
- Animation23.Name = "FallAnim"
- Animation23.Parent = StringValue22
- Animation23.AnimationId = "http://www.roblox.com/asset/?id=125750759"
- StringValue24.Name = "idle"
- StringValue24.Parent = Script19
- Animation25.Name = "Animation1"
- Animation25.Parent = StringValue24
- Animation25.AnimationId = "http://www.roblox.com/asset/?id=125750544"
- NumberValue26.Name = "Weight"
- NumberValue26.Parent = Animation25
- NumberValue26.Value = 9
- Animation27.Name = "Animation2"
- Animation27.Parent = StringValue24
- Animation27.AnimationId = "http://www.roblox.com/asset/?id=125750618"
- NumberValue28.Name = "Weight"
- NumberValue28.Parent = Animation27
- NumberValue28.Value = 1
- StringValue29.Name = "jump"
- StringValue29.Parent = Script19
- Animation30.Name = "JumpAnim"
- Animation30.Parent = StringValue29
- Animation30.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue31.Name = "run"
- StringValue31.Parent = Script19
- Animation32.Name = "RunAnim"
- Animation32.Parent = StringValue31
- Animation32.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- StringValue33.Name = "toolnone"
- StringValue33.Parent = Script19
- Animation34.Name = "ToolNoneAnim"
- Animation34.Parent = StringValue33
- Animation34.AnimationId = "http://www.roblox.com/asset/?id=125750867"
- StringValue35.Name = "walk"
- StringValue35.Parent = Script19
- Animation36.Name = "WalkAnim"
- Animation36.Parent = StringValue35
- Animation36.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- BillboardGui37.Parent = Model0
- BillboardGui37.Size = UDim2.new(0, 100, 0, 30)
- BillboardGui37.StudsOffset = Vector3.new(0, 5, 0)
- TextLabel38.Parent = BillboardGui37
- TextLabel38.Size = UDim2.new(1, 0, 1, 0)
- TextLabel38.Text = "Idle"
- TextLabel38.Visible = false
- TextLabel38.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel38.Font = Enum.Font.SourceSansBold
- TextLabel38.FontSize = Enum.FontSize.Size24
- Sound39.Name = "Moan"
- Sound39.Parent = Model0
- Sound39.Pitch = 0.15000000596046
- Sound39.SoundId = "http://www.roblox.com/asset/?id=12222242"
- Sound39.Volume = 0.050000000745058
- Tool40.Name = "Epic Hammer"
- Tool40.Parent = Model0
- Tool40.GripForward = Vector3.new(-1, -0, -0)
- Tool40.GripPos = Vector3.new(0, 0, -1)
- Tool40.GripRight = Vector3.new(0, 1, 0)
- Tool40.GripUp = Vector3.new(0, 0, 1)
- Tool40.ToolTip = "This can make you dash"
- LocalScript41.Name = "Local Gui"
- LocalScript41.Parent = Tool40
- table.insert(cors,sandbox(LocalScript41,function()
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- wait(1)
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- Tool.Equipped:connect(onEquippedLocal)
- end))
- Script42.Name = "IceHammer"
- Script42.Parent = Tool40
- table.insert(cors,sandbox(Script42,function()
- -------- OMG HAX
- at2 = 0
- debris = game:GetService("Debris")
- r = game:service("RunService")
- cool = 5
- mod = Instance.new("Model")
- mod.Parent = script.Parent
- h = Instance.new("Humanoid")
- h.Parent = mod
- h.MaxHealth = 0
- head = Instance.new("Part")
- head.Name = "Head"
- head.Transparency = 0.989
- head.BrickColor = BrickColor.new("Really black")
- head.formFactor = "Custom"
- head.Size = Vector3.new(0.2,0.2,0.2)
- head.TopSurface = 0
- head.BottomSurface = 0
- head.Anchored = true
- head.Parent = mod
- local damage = 0
- local slash_damage = 12
- sword = script.Parent.Handle
- Tool = script.Parent
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset/?id=926058764"
- SlashSound.Parent = sword
- SlashSound.Pitch = 1
- SlashSound.Volume = 10
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=15933756"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- --local blues = {"Really blue", "Really black", "Black", "Bright blue"}
- function isTurbo(character)
- return character:FindFirstChild("WingwsHeaddess") ~= nil
- end
- function allThatIce(pos, isTurbo)
- local count = 1
- if (isTurbo == true) then count = 1 end
- for i=1,count do
- local p = Instance.new("Part")
- --p.BrickColor = BrickColor.new(blues[math.random(#blues)])
- p.formFactor = "Symmetric"
- p.Name = "ICEY NOOB"
- p.Size = Vector3.new(5,5,1)
- p.BrickColor = BrickColor.new("New Yeller")
- p.TopSurface = 0
- p.Material = "Neon"
- p.Transparency = 0.5
- p.CanCollide = false
- --p.Shape = 0
- p.Friction = 0
- p.Elasticity = 0
- p.BottomSurface = 0
- local a = math.random() * 6.28
- local d = Vector3.new(math.cos(a), 0, math.sin(a)).unit
- bv = script.BodyVelocity:clone()
- bv.Parent = p
- --p.RotVelocity = d * 1000
- p.CFrame = CFrame.new(pos + Vector3.new(0, 0, 0) + (d * 0), Tool.Parent.Torso.CFrame.lookVector * -9999999999)
- --p.CFrame = CFrame.new(p.Position, Tool.Parent.Torso.Position)
- p.Parent = game.Workspace
- debris:AddItem(p, 0.1)
- wait()
- end
- end
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- -- final check, make sure sword is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
- tagHumanoid(humanoid, vPlayer)
- if (isTurbo(vCharacter) == true) then
- humanoid:TakeDamage(damage * 1.2)
- else
- humanoid:TakeDamage(damage)
- end
- end
- end
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- debris:AddItem(creator_tag, 1)
- end
- function attack()
- CHARACTER =script.Parent.Parent
- for i = 1,5 do
- allThatIce(CHARACTER.Torso.Position + (CHARACTER.Torso.CFrame.lookVector * 0) - Vector3.new(0,0,0), isTurbo(CHARACTER))
- end
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- lol = script.Parent.Parent.Torso
- lol.Velocity = script.Parent.Parent.Head.CFrame.lookVector * 150 -- Foward Dash
- wait(0.1)
- lol.Velocity = script.Parent.Parent.Head.CFrame.lookVector * 150 -- Foward Dash
- wait(0.1)
- lol.Velocity = script.Parent.Parent.Head.CFrame.lookVector * 50 -- Foward Dash
- wait(0.1)
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- Tool.Enabled = true
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- if cool >= 1 then
- attack()
- if character.Torso.Velocity.y * -1 < 3 then
- damage = 10
- cool = cool - 1
- b = script.BodyVelocity:clone()
- b.velocity = character.Torso.CFrame.lookVector * 200
- b.Parent = character.Torso
- game:GetService("Debris"):AddItem(b,0.4)
- for i = 1,5 do
- allThatIce(character.Torso.Position + (character.Torso.CFrame.lookVector * 0) - Vector3.new(0,0,0), isTurbo(character))
- end
- damage = 5
- b.velocity = Vector3.new(0,0,0)
- end
- end
- mod.Name = "" .. cool .. ""
- mod.Head.Position = Tool.Handle.Position + Vector3.new(0,10,0)
- wait(0.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- script.Parent.Handle.Boss:Play()
- end
- function Stopmusic()
- script.Parent.Handle.Boss:Stop()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- script.Parent.Unequipped:connect(Stopmusic)
- connection = sword.Touched:connect(blow)
- while true do
- attack()
- Character = Tool.Parent
- Path = Tool.Handle
- attack()
- wait(4)
- swordUp()
- bomb = Instance.new("Part")
- bomb.CFrame = CFrame.fromEulerAnglesXYZ(0,math.pi/20,10)
- bomb.Position = Tool.Handle.Position
- bomb.Material = "Neon"
- bomb.Shape = "0"
- bomb.BrickColor = BrickColor.Red()
- bomb.Name = "Explosion"
- bomb.Anchored = true
- bomb.Parent = workspace
- local anim = Instance.new("Animation")
- anim.AnimationId = "rbxassetid://973866387"
- local playAnim = script.Parent.Parent.Humanoid:LoadAnimation(anim)
- playAnim:Play()
- for n = 1,20 do
- wait()
- bomb.Size = bomb.Size + Vector3.new(1,1,1)
- bomb.Transparency = bomb.Transparency + 0.06
- bomb.CanCollide = false
- end
- bomb:Destroy()
- anim:Destroy()
- Tool.GripForward = Vector3.new(-1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- wait(5)
- attack()
- wait(5)
- attack()
- attack()
- attack()
- attack()
- attack()
- attack()
- attack()
- attack()
- attack()
- attack()
- end
- end))
- BodyVelocity43.Parent = Script42
- BodyVelocity43.Velocity = Vector3.new(0, 0, 0)
- BodyVelocity43.velocity = Vector3.new(0, 0, 0)
- Part44.Name = "Handle"
- Part44.Parent = Tool40
- Part44.BrickColor = BrickColor.new("Really black")
- Part44.Rotation = Vector3.new(90, 90, 0)
- Part44.CanCollide = false
- Part44.Size = Vector3.new(3.1400001, 1.898, 6.28399992)
- Part44.CFrame = CFrame.new(-7.29670906, 3.1299367, -19.070673, -6.79974422e-22, 4.49431016e-21, 1, 0.999999881, 4.72251821e-22, 6.79974523e-22, -4.7225177e-22, 1, -4.49431016e-21)
- Part44.BottomSurface = Enum.SurfaceType.Smooth
- Part44.TopSurface = Enum.SurfaceType.Smooth
- Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part44.Position = Vector3.new(-7.29670906, 3.1299367, -19.070673)
- Part44.Orientation = Vector3.new(0, 90, 90)
- Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Sound45.Name = "Boss"
- Sound45.Parent = Part44
- Sound45.Volume = 2
- SpecialMesh46.Parent = Part44
- SpecialMesh46.MeshId = "rbxassetid://15924243"
- SpecialMesh46.Scale = Vector3.new(2, 2, 2)
- SpecialMesh46.MeshType = Enum.MeshType.FileMesh
- SpecialMesh46.Scale = Vector3.new(2, 2, 2)
- BoolValue47.Name = "CanAttack"
- BoolValue47.Parent = Model0
- Sound48.Parent = Model0
- Sound48.SoundId = "rbxassetid://299247304"
- Sound48.Volume = 5
- Sound48.Looped = true
- Sound48:Play()
- Script49.Name = "Follow"
- Script49.Parent = Model0
- table.insert(cors,sandbox(Script49,function()
- local larm = script.Parent:FindFirstChild("Left Arm")
- local rarm = script.Parent:FindFirstChild("Right Arm")
- function findNearestTorso(pos)
- local list = game.Workspace:children()
- local torso = nil
- local dist = 455
- 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("Torso")
- 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(0.1)
- local target = findNearestTorso(script.Parent.Torso.Position)
- if target ~= nil then
- script.Parent.Humanoid:MoveTo(target.Position, target)
- elseif script.Parent.CanAttack == false then
- script.Parent.CanAttack = true
- end
- end
- end))
- 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
Add Comment
Please, Sign In to add comment