Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(.5)
- --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")
- Part2 = Instance.new("Part")
- Part3 = Instance.new("Part")
- Decal4 = Instance.new("Decal")
- Motor6D5 = Instance.new("Motor6D")
- Motor6D6 = Instance.new("Motor6D")
- Motor6D7 = Instance.new("Motor6D")
- Motor6D8 = Instance.new("Motor6D")
- Motor6D9 = Instance.new("Motor6D")
- Motor6D10 = Instance.new("Motor6D")
- Motor6D11 = Instance.new("Motor6D")
- Decal12 = Instance.new("Decal")
- attac = Instance.new("Attachment")
- attac1 = Instance.new("Attachment")
- attac2 = Instance.new("Attachment")
- attac3 = Instance.new("Attachment")
- Decal13 = Instance.new("Decal")
- RopeConstraint14 = Instance.new("RopeConstraint")
- RopeConstraint15 = Instance.new("RopeConstraint")
- Part16 = Instance.new("Part")
- Part17 = Instance.new("Part")
- RopeConstraint18 = Instance.new("RopeConstraint")
- Part19 = Instance.new("Part")
- Motor6D20 = Instance.new("Motor6D")
- Part21 = Instance.new("Part")
- Part22 = Instance.new("Part")
- Part23 = Instance.new("Part")
- Script24 = Instance.new("Script")
- Sound25 = Instance.new("Sound")
- Part26 = Instance.new("Part")
- Part27 = Instance.new("Part")
- LocalScript29 = Instance.new("LocalScript")
- StringValue30 = Instance.new("StringValue")
- Animation31 = Instance.new("Animation")
- NumberValue32 = Instance.new("NumberValue")
- Animation33 = Instance.new("Animation")
- NumberValue34 = Instance.new("NumberValue")
- StringValue35 = Instance.new("StringValue")
- Animation36 = Instance.new("Animation")
- StringValue37 = Instance.new("StringValue")
- Animation38 = Instance.new("Animation")
- StringValue39 = Instance.new("StringValue")
- Animation40 = Instance.new("Animation")
- StringValue41 = Instance.new("StringValue")
- Animation42 = Instance.new("Animation")
- StringValue43 = Instance.new("StringValue")
- Animation44 = Instance.new("Animation")
- StringValue45 = Instance.new("StringValue")
- Animation46 = Instance.new("Animation")
- StringValue47 = Instance.new("StringValue")
- Animation48 = Instance.new("Animation")
- NumberValue49 = Instance.new("NumberValue")
- Model0.Name = "a"
- Model0.Parent = mas
- Part1.Name = "front right leg"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(1.25000703, 0.975010395, -0.475000978, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(1.25000703, 0.975010395, -0.475000978)
- Part1.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part1.Size = Vector3.new(1, 2, 1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Neon orange")
- Part1.CanCollide = false
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Neon orange")
- Part2.Name = "back left leg"
- Part2.Parent = Model0
- Part2.CFrame = CFrame.new(-1.74999297, 0.975010395, 2.52499914, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.Position = Vector3.new(-1.74999297, 0.975010395, 2.52499914)
- Part2.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part2.Size = Vector3.new(1, 2, 1)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.BrickColor = BrickColor.new("Neon orange")
- Part2.CanCollide = false
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.brickColor = BrickColor.new("Neon orange")
- Part3.Name = "Torso"
- Part3.Parent = Model0
- Part3.CFrame = CFrame.new(-0.249992996, 3.9750104, 1.02499902, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part3.Position = Vector3.new(-0.249992996, 3.9750104, 1.02499902)
- Part3.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part3.Size = Vector3.new(4, 4, 4)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.BrickColor = BrickColor.new("Neon orange")
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.brickColor = BrickColor.new("Neon orange")
- Decal4.Name = "Cat Face"
- Decal4.Parent = Part3
- Decal4.Texture = "http://www.roblox.com/asset/?id=161258368"
- Motor6D5.Name = "stripe1"
- Motor6D5.Parent = Part3
- Motor6D5.C1 = CFrame.new(0, -2.0250001, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D5.Part0 = Part3
- Motor6D5.Part1 = Part23
- Motor6D5.part1 = Part23
- Motor6D6.Name = "stripe2"
- Motor6D6.Parent = Part3
- Motor6D6.C1 = CFrame.new(0, -2.0250001, -1, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D6.Part0 = Part3
- Motor6D6.Part1 = Part26
- Motor6D6.part1 = Part26
- Motor6D7.Name = "fll"
- Motor6D7.Parent = Part3
- Motor6D7.C0 = CFrame.new(-1.60000002, -2, -1.5999999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D7.C1 = CFrame.new(-0.0999999791, 1, -0.0999999493, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D7.Part0 = Part3
- Motor6D7.Part1 = Part16
- Motor6D7.part1 = Part16
- Motor6D8.Name = "bll"
- Motor6D8.Parent = Part3
- Motor6D8.C0 = CFrame.new(-1.39999998, -2, 1.60000014, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D8.C1 = CFrame.new(0.100000024, 0.99999994, 0.100000054, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D8.Part0 = Part3
- Motor6D8.Part1 = Part2
- Motor6D8.part1 = Part2
- Motor6D9.Name = "frl"
- Motor6D9.Parent = Part3
- Motor6D9.C0 = CFrame.new(1.60000002, -1.80000007, -1.60000002, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D9.C1 = CFrame.new(0.100000024, 1.19999993, -0.100000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D9.Part0 = Part3
- Motor6D9.Part1 = Part1
- Motor6D9.part1 = Part1
- Motor6D10.Name = "brl"
- Motor6D10.Parent = Part3
- Motor6D10.C0 = CFrame.new(1.60000002, -2, 1.60000002, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D10.C1 = CFrame.new(0.100000024, 0.99999994, 0.100000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D10.Part0 = Part3
- Motor6D10.Part1 = Part21
- Motor6D10.part1 = Part21
- Motor6D11.Name = "Head"
- Motor6D11.Parent = Part3
- Motor6D11.C1 = CFrame.new(0, -1, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Motor6D11.Part0 = Part3
- Motor6D11.Part1 = Part27
- Motor6D11.part1 = Part27
- Decal12.Name = "award winning art"
- Decal12.Parent = Part3
- Decal12.Texture = "http://www.roblox.com/asset/?id=2912303330"
- Decal12.Face = Enum.NormalId.Left
- Decal13.Name = "award winning art"
- Decal13.Parent = Part3
- Decal13.Texture = "http://www.roblox.com/asset/?id=2912303330"
- Decal13.Face = Enum.NormalId.Right
- attac.Name = "attac"
- attac.Parent = Part3
- attac.Position = Vector3.new(0,-.35,2)
- attac1.Name = "attac1"
- attac1.Parent = Part17
- attac1.Position = Vector3.new(0,-1,-0.15)
- attac2.Name = "attac2"
- attac2.Parent = Part17
- attac2.Position = Vector3.new(0,1,0)
- attac3.Name = "attac3"
- attac3.Parent = Part22
- attac3.Position = Vector3.new(0,-.775,0)
- RopeConstraint14.Parent = Part3
- RopeConstraint14.Length = 0.034995075315237
- RopeConstraint14.Visible = true
- RopeConstraint14.Attachment0 = attac
- RopeConstraint14.Attachment1 = attac1
- RopeConstraint15.Parent = Part3
- RopeConstraint15.Length = 0.034995075315237
- RopeConstraint15.Visible = true
- RopeConstraint15.Attachment0 = attac
- RopeConstraint15.Attachment1 = attac1
- Part16.Name = "front left leg"
- Part16.Parent = Model0
- Part16.CFrame = CFrame.new(-1.74999297, 0.975010395, -0.475000978, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part16.Position = Vector3.new(-1.74999297, 0.975010395, -0.475000978)
- Part16.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part16.Size = Vector3.new(1, 2, 1)
- Part16.BottomSurface = Enum.SurfaceType.Smooth
- Part16.BrickColor = BrickColor.new("Neon orange")
- Part16.CanCollide = false
- Part16.TopSurface = Enum.SurfaceType.Smooth
- Part16.brickColor = BrickColor.new("Neon orange")
- Part17.Name = "tail1"
- Part17.Parent = Model0
- Part17.CFrame = CFrame.new(-0.249992996, 3.4707334, 4.0597291, 1, 0, 0, 0, 0, -1, 0, 1, 0)
- Part17.Orientation = Vector3.new(90, 0, 0)
- Part17.Position = Vector3.new(-0.249992996, 3.4707334, 4.0597291)
- Part17.Rotation = Vector3.new(90, 0, 0)
- Part17.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part17.Size = Vector3.new(1, 2, 1)
- Part17.BottomSurface = Enum.SurfaceType.Smooth
- Part17.BrickColor = BrickColor.new("Neon orange")
- Part17.CanCollide = false
- Part17.TopSurface = Enum.SurfaceType.Smooth
- Part17.brickColor = BrickColor.new("Neon orange")
- RopeConstraint18.Parent = Part17
- RopeConstraint18.Length = 0.30000001192093
- RopeConstraint18.Visible = true
- RopeConstraint18.Attachment0 = attac2
- RopeConstraint18.Attachment1 = attac3
- Part19.Name = "HumanoidRootPart"
- Part19.Parent = Model0
- Part19.CFrame = CFrame.new(-0.249992996, 3.9750104, 1.02499902, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part19.Position = Vector3.new(-0.249992996, 3.9750104, 1.02499902)
- Part19.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part19.Size = Vector3.new(2, 2, 2)
- Part19.BottomSurface = Enum.SurfaceType.Smooth
- Part19.BrickColor = BrickColor.new("Neon orange")
- Part19.TopSurface = Enum.SurfaceType.Smooth
- Part19.brickColor = BrickColor.new("Neon orange")
- Motor6D20.Name = "Torso"
- Motor6D20.Parent = Part19
- Motor6D20.Part0 = Part19
- Motor6D20.Part1 = Part3
- Motor6D20.part1 = Part3
- Part21.Name = "back right leg"
- Part21.Parent = Model0
- Part21.CFrame = CFrame.new(1.25000703, 0.975010395, 2.52499914, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part21.Position = Vector3.new(1.25000703, 0.975010395, 2.52499914)
- Part21.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part21.Size = Vector3.new(1, 2, 1)
- Part21.BottomSurface = Enum.SurfaceType.Smooth
- Part21.BrickColor = BrickColor.new("Neon orange")
- Part21.CanCollide = false
- Part21.TopSurface = Enum.SurfaceType.Smooth
- Part21.brickColor = BrickColor.new("Neon orange")
- Part22.Name = "tail2"
- Part22.Parent = Model0
- Part22.CFrame = CFrame.new(-0.249992996, 3.45801449, 5.8580308, 1, 0, 0, 0, 0, -1, 0, 1, 0)
- Part22.Orientation = Vector3.new(90, 0, 0)
- Part22.Position = Vector3.new(-0.249992996, 3.45801449, 5.8580308)
- Part22.Rotation = Vector3.new(90, 0, 0)
- Part22.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part22.Size = Vector3.new(1, 1.55000007, 1)
- Part22.BottomSurface = Enum.SurfaceType.Smooth
- Part22.BrickColor = BrickColor.new("Neon orange")
- Part22.CanCollide = false
- Part22.CollisionGroupId = 1
- Part22.TopSurface = Enum.SurfaceType.Smooth
- Part22.brickColor = BrickColor.new("Neon orange")
- Part23.Name = "stipe 1"
- Part23.Parent = Model0
- Part23.CFrame = CFrame.new(-0.249992996, 6.00001049, 0.0249990225, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part23.Position = Vector3.new(-0.249992996, 6.00001049, 0.0249990225)
- Part23.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part23.Size = Vector3.new(3.9000001, 0.0500000715, 1)
- Part23.BottomSurface = Enum.SurfaceType.Smooth
- Part23.BrickColor = BrickColor.new("Reddish brown")
- Part23.CanCollide = false
- Part23.TopSurface = Enum.SurfaceType.Smooth
- Part23.brickColor = BrickColor.new("Reddish brown")
- Script24.Name = "i told u ppl"
- Script24.Parent = Part23
- Sound25.Name = "Song"
- Sound25.Parent = Script24
- Sound25.SoundId = "rbxassetid://1091083826"
- Sound25.Volume = 1
- Part26.Name = "stripe 2"
- Part26.Parent = Model0
- Part26.CFrame = CFrame.new(-0.249992996, 6.00001049, 2.02499914, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part26.Position = Vector3.new(-0.249992996, 6.00001049, 2.02499914)
- Part26.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part26.Size = Vector3.new(3.9000001, 0.0500000715, 1)
- Part26.BottomSurface = Enum.SurfaceType.Smooth
- Part26.BrickColor = BrickColor.new("Reddish brown")
- Part26.CanCollide = false
- Part26.TopSurface = Enum.SurfaceType.Smooth
- Part26.brickColor = BrickColor.new("Reddish brown")
- Part27.Name = "Head"
- Part27.Parent = Model0
- Part27.CFrame = CFrame.new(-0.249992996, 4.9750104, 0.524999022, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part27.Position = Vector3.new(-0.249992996, 4.9750104, 0.524999022)
- Part27.Color = Color3.new(0.835294, 0.45098, 0.239216)
- Part27.Size = Vector3.new(2, 2, 2)
- Part27.BottomSurface = Enum.SurfaceType.Smooth
- Part27.BrickColor = BrickColor.new("Neon orange")
- Part27.CanCollide = false
- Part27.TopSurface = Enum.SurfaceType.Smooth
- Part27.brickColor = BrickColor.new("Neon orange")
- LocalScript29.Name = "Animate"
- LocalScript29.Parent = Model0
- table.insert(cors,sandbox(LocalScript29,function()
- local Figure = script.Parent
- local Torso = Figure:WaitForChild("Torso")
- local RightShoulder = Torso:WaitForChild("Right Shoulder")
- local LeftShoulder = Torso:WaitForChild("Left Shoulder")
- local RightHip = Torso:WaitForChild("Right Hip")
- local LeftHip = Torso:WaitForChild("Left Hip")
- local Neck = Torso:WaitForChild("Neck")
- local Humanoid = Figure:WaitForChild("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=2912266963", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=2912266963", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=2912268301", 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=180436148", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
- },
- sit = {
- { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=182393478", 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 }
- },
- dance1 = {
- { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- local dances = {"dance1", "dance2", "dance3"}
- -- 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, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- 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 = ""
- 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
- 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.0, 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)
- currentAnimTrack.Priority = Enum.AnimationPriority.Core
- -- 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, priority)
- 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)
- if priority then
- toolAnimTrack.Priority = priority
- end
- -- 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
- playAnimation("walk", 0.1, Humanoid)
- if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
- setAnimationSpeed(speed / 14.5)
- end
- pose = "Running"
- else
- if emoteNames[currentAnim] == nil then
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- 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, Enum.AnimationPriority.Idle)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
- 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
- -- print("Wha " .. pose)
- stopAllAnimations()
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- local 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 and tool:FindFirstChild("Handle") then
- local 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
- game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
- local emote = ""
- if msg == "/e dance" then
- emote = dances[math.random(1, #dances)]
- elseif (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
- end)
- -- main program
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent ~= nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue30.Name = "idle"
- StringValue30.Parent = LocalScript29
- Animation31.Name = "Animation1"
- Animation31.Parent = StringValue30
- Animation31.AnimationId = "rbxassetid://2912268301"
- NumberValue32.Name = "Weight"
- NumberValue32.Parent = Animation31
- NumberValue32.Value = 9
- Animation33.Name = "Animation2"
- Animation33.Parent = StringValue30
- Animation33.AnimationId = "rbxassetid://2912268301"
- NumberValue34.Name = "Weight"
- NumberValue34.Parent = Animation33
- NumberValue34.Value = 1
- StringValue35.Name = "walk"
- StringValue35.Parent = LocalScript29
- Animation36.Name = "WalkAnim"
- Animation36.Parent = StringValue35
- Animation36.AnimationId = "rbxassetid://2912266963"
- StringValue37.Name = "run"
- StringValue37.Parent = LocalScript29
- Animation38.Name = "RunAnim"
- Animation38.Parent = StringValue37
- Animation38.AnimationId = "rbxassetid://2912266963"
- StringValue39.Name = "jump"
- StringValue39.Parent = LocalScript29
- Animation40.Name = "JumpAnim"
- Animation40.Parent = StringValue39
- Animation40.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue41.Name = "climb"
- StringValue41.Parent = LocalScript29
- Animation42.Name = "ClimbAnim"
- Animation42.Parent = StringValue41
- Animation42.AnimationId = "http://www.roblox.com/asset/?id=180436334"
- StringValue43.Name = "toolnone"
- StringValue43.Parent = LocalScript29
- Animation44.Name = "ToolNoneAnim"
- Animation44.Parent = StringValue43
- Animation44.AnimationId = "http://www.roblox.com/asset/?id=182393478"
- StringValue45.Name = "fall"
- StringValue45.Parent = LocalScript29
- Animation46.Name = "FallAnim"
- Animation46.Parent = StringValue45
- Animation46.AnimationId = "http://www.roblox.com/asset/?id=180436148"
- StringValue47.Name = "sit"
- StringValue47.Parent = LocalScript29
- Animation48.Name = "SitAnim"
- Animation48.Parent = StringValue47
- Animation48.AnimationId = "http://www.roblox.com/asset/?id=178130996"
- NumberValue49.Name = "ScaleDampeningPercent"
- NumberValue49.Parent = LocalScript29
- NumberValue49.Value = 0.40000000596046
- 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
- local Torso = game.workspace.lafur2.Torso
- local weld = Instance.new("Weld",Torso)
- weld.C0 = Torso.CFrame:Inverse() * workspace.a.Torso.CFrame
- weld.Part0 = Torso
- weld.Part1 = workspace.a.Torso
- local a = Torso.Parent
- c = a:GetChildren()
- for i=1, #c do
- if (c[i].className == "Accessory") then
- c[i]:remove()
- end
- end
- Torso.Transparency = 1
- a.Head.Transparency = 1
- a["Left Arm"].Transparency = 1
- a["Right Arm"].Transparency = 1
- a["Left Leg"].Transparency = 1
- a["Right Leg"].Transparency = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement