Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Created by PenguinAnonymous (ttyyuu12345) Editied by Dittoide
- --What's Added To M2S with Dittoide's Edit?
- --/ Better dummy script function to improve compatibility (makes it like you are running the code inside the script.)
- --/ Removed Gui In Bottom-Left for when you are making guis.
- --/ Removed "Inserting Map Please Wait" gui when selected Workspace as Place to export.
- --Credit: PenguinAnonymous for making original script, i just wanted to iron it out to my liking.
- --Errors: Camera,Terrain,Attachment,Status,Animator,Accessory
- local runDummyScript = function(f,scri)
- if (not scri:IsA('Script')) or (not scri:IsA('LocalScript')) then return false; end;
- local Dummy_CoRoutine = coroutine.create(function()
- getfenv().script = scri
- ypcall(function() f() end)
- end)
- table.insert(cors,Dummy_CoRoutine);
- coroutine.resume(Dummy_CoRoutine);
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- mas.Name = "M2S_Model"
- o3 = Instance.new("Model")
- o4 = Instance.new("Script")
- o5 = Instance.new("Model")
- o6 = Instance.new("Model")
- o7 = Instance.new("Part")
- o8 = Instance.new("SpecialMesh")
- o9 = Instance.new("Part")
- o10 = Instance.new("Part")
- o11 = Instance.new("Part")
- o12 = Instance.new("Part")
- o13 = Instance.new("Part")
- o14 = Instance.new("Model")
- o15 = Instance.new("Part")
- o16 = Instance.new("SpecialMesh")
- o21 = Instance.new("Sound")
- o22 = Instance.new("RemoteEvent")
- o23 = Instance.new("Sound")
- o24 = Instance.new("RemoteEvent")
- o25 = Instance.new("Sound")
- o26 = Instance.new("RemoteEvent")
- o27 = Instance.new("Sound")
- o28 = Instance.new("RemoteEvent")
- o29 = Instance.new("Sound")
- o30 = Instance.new("RemoteEvent")
- o31 = Instance.new("Sound")
- o32 = Instance.new("RemoteEvent")
- o33 = Instance.new("Sound")
- o34 = Instance.new("RemoteEvent")
- o35 = Instance.new("Sound")
- o36 = Instance.new("RemoteEvent")
- o37 = Instance.new("Sound")
- o38 = Instance.new("RemoteEvent")
- o39 = Instance.new("Decal")
- o40 = Instance.new("Part")
- o41 = Instance.new("Decal")
- o50 = Instance.new("Motor6D")
- o51 = Instance.new("Motor6D")
- o52 = Instance.new("Motor6D")
- o53 = Instance.new("Motor6D")
- o54 = Instance.new("Motor6D")
- o55 = Instance.new("Part")
- o58 = Instance.new("Part")
- o61 = Instance.new("Part")
- o63 = Instance.new("Part")
- o65 = Instance.new("Humanoid")
- o68 = Instance.new("Part")
- o70 = Instance.new("Motor6D")
- o71 = Instance.new("Script")
- o72 = Instance.new("LocalScript")
- o73 = Instance.new("Script")
- o74 = Instance.new("LocalScript")
- o75 = Instance.new("StringValue")
- o76 = Instance.new("Animation")
- o77 = Instance.new("NumberValue")
- o78 = Instance.new("Animation")
- o79 = Instance.new("NumberValue")
- o80 = Instance.new("StringValue")
- o81 = Instance.new("Animation")
- o82 = Instance.new("StringValue")
- o83 = Instance.new("Animation")
- o84 = Instance.new("StringValue")
- o85 = Instance.new("Animation")
- o86 = Instance.new("StringValue")
- o87 = Instance.new("Animation")
- o88 = Instance.new("StringValue")
- o89 = Instance.new("Animation")
- o90 = Instance.new("StringValue")
- o91 = Instance.new("Animation")
- o92 = Instance.new("StringValue")
- o93 = Instance.new("Animation")
- o94 = Instance.new("NumberValue")
- o95 = Instance.new("BodyColors")
- o96 = Instance.new("Pants")
- o98 = Instance.new("Part")
- o99 = Instance.new("SpecialMesh")
- o101 = Instance.new("Vector3Value")
- o102 = Instance.new("Weld")
- o103 = Instance.new("Shirt")
- o3.Name = "Compiled scripts"
- o3.Parent = mas
- o4.Name = "CScript1"
- o4.Parent = o3
- o4.Disabled = true
- runDummyScript(function()
- --Created by PenguinAnonymous (ttyyuu12345) Editied by Dittoide
- --What's Added To M2S with Dittoide's Edit?
- --/ Better dummy script function to improve compatibility (makes it like you are running the code inside the script.)
- --/ Removed Gui In Bottom-Left for when you are making guis.
- --/ Removed "Inserting Map Please Wait" gui when selected Workspace as Place to export.
- --Credit: PenguinAnonymous for making original script, i just wanted to iron it out to my liking.
- --Errors: Camera,Terrain
- local runDummyScript = function(f,scri)
- if (not scri:IsA('Script')) or (not scri:IsA('LocalScript')) then return false; end;
- local Dummy_CoRoutine = coroutine.create(function()
- getfenv().script = scri
- ypcall(function() f() end)
- end)
- table.insert(cors,Dummy_CoRoutine);
- coroutine.resume(Dummy_CoRoutine);
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- mas.Name = "M2S_Model"
- o3 = Instance.new("Model")
- o4 = Instance.new("Part")
- o5 = Instance.new("SpecialMesh")
- o6 = Instance.new("Part")
- o7 = Instance.new("Part")
- o8 = Instance.new("Part")
- o9 = Instance.new("Part")
- o10 = Instance.new("Part")
- o3.Parent = mas
- o4.Parent = o3
- o4.BrickColor = BrickColor.new("Dark stone grey")
- o4.Transparency = 0.30000001192093
- o4.Position = Vector3.new(-19.7996979, 32.7543106, 52)
- o4.Rotation = Vector3.new(-86.5400009, 29.9599991, -1.73000002)
- o4.Size = Vector3.new(4, 2.4000001, 2)
- o4.CFrame = CFrame.new(-19.7996979, 32.7543106, 52, 0.865938365, 0.0261758789, 0.499465615, -0.500151098, 0.0453196988, 0.864751697, 1.86264537e-09, -0.998629689, 0.052335944)
- o4.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o4.Position = Vector3.new(-19.7996979, 32.7543106, 52)
- o5.Parent = o4
- o5.MeshId = "http://www.roblox.com/asset/?id=12221720"
- o5.Scale = Vector3.new(4, 4, 4)
- o5.MeshType = Enum.MeshType.FileMesh
- o6.Parent = o3
- o6.BrickColor = BrickColor.new("Dark stone grey")
- o6.Position = Vector3.new(-26, 21.7224236, 51)
- o6.Rotation = Vector3.new(-90, -59.9899979, 90)
- o6.Size = Vector3.new(4, 9.60000038, 4)
- o6.CFrame = CFrame.new(-26, 21.7224236, 51, 0, -0.500150919, -0.865937889, 0, -0.865937889, 0.500150919, -1, 0, 0)
- o6.BottomSurface = Enum.SurfaceType.Smooth
- o6.TopSurface = Enum.SurfaceType.Smooth
- o6.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o6.Position = Vector3.new(-26, 21.7224236, 51)
- o7.Parent = o3
- o7.BrickColor = BrickColor.new("Dark stone grey")
- o7.Position = Vector3.new(-32, 16.7224045, 51)
- o7.Rotation = Vector3.new(0, 90, 0)
- o7.Size = Vector3.new(4, 9.60000038, 8)
- o7.CFrame = CFrame.new(-32, 16.7224045, 51, -0, 0, 1, -0, 1, 0, -1, 0, 0)
- o7.TopSurface = Enum.SurfaceType.Smooth
- o7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o7.Position = Vector3.new(-32, 16.7224045, 51)
- o8.Parent = o3
- o8.BrickColor = BrickColor.new("Dark stone grey")
- o8.Position = Vector3.new(-39.0000038, 17.5224171, 51)
- o8.Rotation = Vector3.new(90, 69, -90)
- o8.Size = Vector3.new(4, 9.60000038, 4)
- o8.CFrame = CFrame.new(-39.0000038, 17.5224171, 51, 0, 0.358368039, 0.933580935, 0, 0.933580935, -0.358368039, -1, 0, 0)
- o8.BottomSurface = Enum.SurfaceType.Smooth
- o8.TopSurface = Enum.SurfaceType.Smooth
- o8.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o8.Position = Vector3.new(-39.0000038, 17.5224171, 51)
- o9.Parent = o3
- o9.BrickColor = BrickColor.new("Dark stone grey")
- o9.Position = Vector3.new(-29, 7.72241306, 51)
- o9.Rotation = Vector3.new(-90, 75, 90)
- o9.Size = Vector3.new(4, 10.8000002, 4)
- o9.CFrame = CFrame.new(-29, 7.72241306, 51, 0, -0.258819133, 0.96592629, 0, 0.96592629, 0.258819133, -1, 0, 0)
- o9.TopSurface = Enum.SurfaceType.Smooth
- o9.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o9.Position = Vector3.new(-29, 7.72241306, 51)
- o10.Parent = o3
- o10.BrickColor = BrickColor.new("Dark stone grey")
- o10.Position = Vector3.new(-34, 7.12241077, 51)
- o10.Rotation = Vector3.new(0, 90, 0)
- o10.Size = Vector3.new(4, 9.60000038, 4)
- o10.CFrame = CFrame.new(-34, 7.12241077, 51, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- o10.TopSurface = Enum.SurfaceType.Smooth
- o10.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o10.Position = Vector3.new(-34, 7.12241077, 51)
- 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
- mess_handle.Text = "Resetting"
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- v:LoadCharacter()
- end
- wait(1)
- mess_handle:Remove()
- end,o4)
- o5.Parent = mas
- o6.Parent = o5
- o7.Parent = o6
- o7.BrickColor = BrickColor.new("Dark stone grey")
- o7.Transparency = 0.30000001192093
- o7.Position = Vector3.new(-19.7996979, 32.7543106, 52)
- o7.Rotation = Vector3.new(-86.5400009, 29.9599991, -1.73000002)
- o7.Anchored = true
- o7.Size = Vector3.new(4, 2.4000001, 2)
- o7.CFrame = CFrame.new(-19.7996979, 32.7543106, 52, 0.865948319, 0.0261648297, 0.499448657, -0.500133574, 0.0452957153, 0.864762843, 3.50177288e-06, -0.998630941, 0.0523096323)
- o7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o7.Position = Vector3.new(-19.7996979, 32.7543106, 52)
- o8.Parent = o7
- o8.MeshId = "http://www.roblox.com/asset/?id=12221720"
- o8.Scale = Vector3.new(4, 4, 4)
- o8.MeshType = Enum.MeshType.FileMesh
- o9.Parent = o6
- o9.BrickColor = BrickColor.new("Dark stone grey")
- o9.Position = Vector3.new(-26, 21.7224236, 51)
- o9.Rotation = Vector3.new(-90, -59.9899979, 90)
- o9.Anchored = true
- o9.Size = Vector3.new(4, 9.60000038, 4)
- o9.CFrame = CFrame.new(-26, 21.7224236, 51, 3.40938568e-05, -0.500193477, -0.86591363, -9.14931297e-06, -0.86591363, 0.500193477, -1, -9.14931297e-06, -3.40938568e-05)
- o9.BottomSurface = Enum.SurfaceType.Smooth
- o9.TopSurface = Enum.SurfaceType.Smooth
- o9.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o9.Position = Vector3.new(-26, 21.7224236, 51)
- o10.Parent = o6
- o10.BrickColor = BrickColor.new("Dark stone grey")
- o10.Position = Vector3.new(-32, 16.7224045, 51)
- o10.Rotation = Vector3.new(0, 90, 0)
- o10.Anchored = true
- o10.Size = Vector3.new(4, 9.60000038, 8)
- o10.CFrame = CFrame.new(-32, 16.7224045, 51, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- o10.TopSurface = Enum.SurfaceType.Smooth
- o10.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o10.Position = Vector3.new(-32, 16.7224045, 51)
- o11.Parent = o6
- o11.BrickColor = BrickColor.new("Dark stone grey")
- o11.Position = Vector3.new(-39.0000038, 17.5224171, 51)
- o11.Rotation = Vector3.new(90.0099945, 69, -90.0099945)
- o11.Anchored = true
- o11.Size = Vector3.new(4, 9.60000038, 4)
- o11.CFrame = CFrame.new(-39.0000038, 17.5224171, 51, -4.99486923e-05, 0.358418405, 0.933561087, 9.2536211e-06, 0.933561087, -0.358418405, -1, -9.2536211e-06, -4.99486923e-05)
- o11.BottomSurface = Enum.SurfaceType.Smooth
- o11.TopSurface = Enum.SurfaceType.Smooth
- o11.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o11.Position = Vector3.new(-39.0000038, 17.5224171, 51)
- o12.Parent = o6
- o12.BrickColor = BrickColor.new("Dark stone grey")
- o12.Position = Vector3.new(-29, 7.72241306, 51)
- o12.Rotation = Vector3.new(-90, 75, 90)
- o12.Anchored = true
- o12.Size = Vector3.new(4, 10.8000002, 4)
- o12.CFrame = CFrame.new(-29, 7.72241306, 51, -1.26361847e-05, -0.258770168, 0.965938866, -1.68383121e-06, 0.965938926, 0.258770168, -0.99999994, 1.68383121e-06, -1.26361847e-05)
- o12.TopSurface = Enum.SurfaceType.Smooth
- o12.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o12.Position = Vector3.new(-29, 7.72241306, 51)
- o13.Parent = o6
- o13.BrickColor = BrickColor.new("Dark stone grey")
- o13.Position = Vector3.new(-34, 7.12241077, 51)
- o13.Rotation = Vector3.new(0, 90, 0)
- o13.Anchored = true
- o13.Size = Vector3.new(4, 9.60000038, 4)
- o13.CFrame = CFrame.new(-34, 7.12241077, 51, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- o13.TopSurface = Enum.SurfaceType.Smooth
- o13.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o13.Position = Vector3.new(-34, 7.12241077, 51)
- o14.Name = "timetodie23232223"
- o14.Parent = mas
- o14.Archivable = false
- o14.PrimaryPart = o15
- o15.Name = "Head"
- o15.Parent = o14
- o15.BrickColor = BrickColor.new("Pastel brown")
- o15.Position = Vector3.new(-24.0668049, 6.47494841, 40.683567)
- o15.Rotation = Vector3.new(-0.269999981, -34.9199982, -0.159999996)
- o15.Locked = true
- o15.FormFactor = Enum.FormFactor.Symmetric
- o15.Size = Vector3.new(2, 1, 1)
- o15.CFrame = CFrame.new(-24.0668049, 6.47494841, 40.683567, 0.819974363, 0.00224036095, -0.572395802, -1.41710725e-05, 0.99999243, 0.00389366131, 0.572400212, -0.00318458513, 0.819968224)
- o15.TopSurface = Enum.SurfaceType.Smooth
- o15.Color = Color3.new(1, 0.8, 0.6)
- o15.Position = Vector3.new(-24.0668049, 6.47494841, 40.683567)
- o16.Parent = o15
- o16.Scale = Vector3.new(1.25, 1.25, 1.25)
- o21.Name = "GettingUp"
- o21.Parent = o15
- o21.Archivable = false
- o21.SoundId = "rbxasset://sounds/action_get_up.mp3"
- o21.Volume = 0.64999997615814
- o22.Name = "CharacterSoundEvent"
- o22.Parent = o21
- o23.Name = "Died"
- o23.Parent = o15
- o23.Archivable = false
- o23.SoundId = "rbxasset://sounds/uuhhh.mp3"
- o23.Volume = 0.64999997615814
- o24.Name = "CharacterSoundEvent"
- o24.Parent = o23
- o25.Name = "FreeFalling"
- o25.Parent = o15
- o25.Archivable = false
- o25.SoundId = "rbxasset://sounds/action_falling.mp3"
- o25.TimePosition = 0.20340387445407
- o25.Volume = 1
- o25.Looped = true
- o26.Name = "CharacterSoundEvent"
- o26.Parent = o25
- o27.Name = "Jumping"
- o27.Parent = o15
- o27.Archivable = false
- o27.SoundId = "rbxasset://sounds/action_jump.mp3"
- o27.Volume = 0.64999997615814
- o28.Name = "CharacterSoundEvent"
- o28.Parent = o27
- o29.Name = "Landing"
- o29.Parent = o15
- o29.Archivable = false
- o29.SoundId = "rbxasset://sounds/action_jump_land.mp3"
- o29.Volume = 1
- o30.Name = "CharacterSoundEvent"
- o30.Parent = o29
- o31.Name = "Splash"
- o31.Parent = o15
- o31.Archivable = false
- o31.SoundId = "rbxasset://sounds/impact_water.mp3"
- o31.Volume = 0.64999997615814
- o32.Name = "CharacterSoundEvent"
- o32.Parent = o31
- o33.Name = "Running"
- o33.Parent = o15
- o33.Archivable = false
- o33.Pitch = 1.8500000238419
- o33.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
- o33.TimePosition = 0.85750264926479
- o33.Volume = 0.64999997615814
- o33.Looped = true
- o34.Name = "CharacterSoundEvent"
- o34.Parent = o33
- o35.Name = "Swimming"
- o35.Parent = o15
- o35.Archivable = false
- o35.Pitch = 1.6000000238419
- o35.SoundId = "rbxasset://sounds/action_swim.mp3"
- o35.Volume = 0.64999997615814
- o35.Looped = true
- o36.Name = "CharacterSoundEvent"
- o36.Parent = o35
- o37.Name = "Climbing"
- o37.Parent = o15
- o37.Archivable = false
- o37.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
- o37.Volume = 0.64999997615814
- o37.Looped = true
- o38.Name = "CharacterSoundEvent"
- o38.Parent = o37
- o39.Name = "face"
- o39.Parent = o15
- o39.Texture = "http://www.roblox.com/asset/?id=13038247"
- o40.Name = "Torso"
- o40.Parent = o14
- o40.BrickColor = BrickColor.new("Pastel brown")
- o40.Position = Vector3.new(-24.0679245, 4.97538948, 40.6851578)
- o40.Rotation = Vector3.new(0, -35.1300011, 0)
- o40.Locked = true
- o40.FormFactor = Enum.FormFactor.Symmetric
- o40.Size = Vector3.new(2, 2, 1)
- o40.CFrame = CFrame.new(-24.0679245, 4.97538948, 40.6851578, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
- o40.LeftSurface = Enum.SurfaceType.Weld
- o40.RightSurface = Enum.SurfaceType.Weld
- o40.Color = Color3.new(1, 0.8, 0.6)
- o40.Position = Vector3.new(-24.0679245, 4.97538948, 40.6851578)
- o41.Name = "roblox"
- o41.Parent = o40
- o50.Name = "Right Shoulder"
- o50.Parent = o40
- o50.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- o50.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- o50.Part0 = o40
- o50.Part1 = o58
- o50.CurrentAngle = 0.0067748897708952
- o50.MaxVelocity = 0.10000000149012
- o51.Name = "Left Shoulder"
- o51.Parent = o40
- o51.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- o51.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- o51.Part0 = o40
- o51.Part1 = o55
- o51.CurrentAngle = -0.0048912507481873
- o51.MaxVelocity = 0.10000000149012
- o52.Name = "Right Hip"
- o52.Parent = o40
- o52.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- o52.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- o52.Part0 = o40
- o52.Part1 = o63
- o52.MaxVelocity = 0.10000000149012
- o53.Name = "Left Hip"
- o53.Parent = o40
- o53.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- o53.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- o53.Part0 = o40
- o53.Part1 = o61
- o53.MaxVelocity = 0.10000000149012
- o54.Name = "Neck"
- o54.Parent = o40
- o54.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o54.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o54.Part0 = o40
- o54.Part1 = o15
- o54.CurrentAngle = 0.0017011311138049
- o54.MaxVelocity = 0.10000000149012
- o55.Name = "Left Arm"
- o55.Parent = o14
- o55.BrickColor = BrickColor.new("Pastel brown")
- o55.Position = Vector3.new(-25.2920303, 4.99553108, 39.8180618)
- o55.Rotation = Vector3.new(0.0799999982, -35.6100006, 0.0299999993)
- o55.CanCollide = false
- o55.Locked = true
- o55.FormFactor = Enum.FormFactor.Symmetric
- o55.Size = Vector3.new(1, 2, 1)
- o55.CFrame = CFrame.new(-25.2920303, 4.99553108, 39.8180618, 0.812950552, -0.000495347544, -0.582332551, -0.000223319279, 0.999999285, -0.00116239686, 0.582332671, 0.00107502041, 0.812949896)
- o55.Color = Color3.new(1, 0.8, 0.6)
- o55.Position = Vector3.new(-25.2920303, 4.99553108, 39.8180618)
- o58.Name = "Right Arm"
- o58.Parent = o14
- o58.BrickColor = BrickColor.new("Pastel brown")
- o58.Position = Vector3.new(-22.8415451, 5.00299072, 41.5513611)
- o58.Rotation = Vector3.new(-0.189999998, -35.2900009, 0.049999997)
- o58.CanCollide = false
- o58.Locked = true
- o58.FormFactor = Enum.FormFactor.Symmetric
- o58.Size = Vector3.new(1, 2, 1)
- o58.CFrame = CFrame.new(-22.8415451, 5.00299072, 41.5513611, 0.816229939, -0.000772229396, -0.577726662, 0.00288561243, 0.999992073, 0.00274024741, 0.577719927, -0.0039037643, 0.816225767)
- o58.Color = Color3.new(1, 0.8, 0.6)
- o58.Position = Vector3.new(-22.8415451, 5.00299072, 41.5513611)
- o61.Name = "Left Leg"
- o61.Parent = o14
- o61.BrickColor = BrickColor.new("Pastel brown")
- o61.Position = Vector3.new(-24.4768639, 2.99952984, 40.3974609)
- o61.Rotation = Vector3.new(0, -35.1300011, 0)
- o61.CanCollide = false
- o61.Locked = true
- o61.FormFactor = Enum.FormFactor.Symmetric
- o61.Size = Vector3.new(1, 2, 1)
- o61.CFrame = CFrame.new(-24.4768639, 2.99952984, 40.3974609, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
- o61.BottomSurface = Enum.SurfaceType.Smooth
- o61.Color = Color3.new(1, 0.8, 0.6)
- o61.Position = Vector3.new(-24.4768639, 2.99952984, 40.3974609)
- o63.Name = "Right Leg"
- o63.Parent = o14
- o63.BrickColor = BrickColor.new("Pastel brown")
- o63.Position = Vector3.new(-23.6589851, 2.99616575, 40.9728546)
- o63.Rotation = Vector3.new(0, -35.1300011, 0)
- o63.CanCollide = false
- o63.Locked = true
- o63.FormFactor = Enum.FormFactor.Symmetric
- o63.Size = Vector3.new(1, 2, 1)
- o63.CFrame = CFrame.new(-23.6589851, 2.99616575, 40.9728546, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
- o63.BottomSurface = Enum.SurfaceType.Smooth
- o63.Color = Color3.new(1, 0.8, 0.6)
- o63.Position = Vector3.new(-23.6589851, 2.99616575, 40.9728546)
- o65.Parent = o14
- o65.RightLeg = o63
- o65.LeftLeg = o61
- o65.Torso = o68
- o68.Name = "HumanoidRootPart"
- o68.Parent = o14
- o68.Transparency = 1
- o68.Position = Vector3.new(-24.0679245, 5, 40.6851578)
- o68.Rotation = Vector3.new(0, -35.1300011, 0)
- o68.CanCollide = false
- o68.Locked = true
- o68.FormFactor = Enum.FormFactor.Symmetric
- o68.Size = Vector3.new(2, 2, 1)
- o68.CFrame = CFrame.new(-24.0679245, 5, 40.6851578, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
- o68.BottomSurface = Enum.SurfaceType.Smooth
- o68.TopSurface = Enum.SurfaceType.Smooth
- o68.Position = Vector3.new(-24.0679245, 5, 40.6851578)
- o70.Name = "RootJoint"
- o70.Parent = o68
- o70.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o70.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- o70.Part0 = o68
- o70.Part1 = o40
- o70.MaxVelocity = 0.10000000149012
- o71.Name = "Sound"
- o71.Parent = o14
- runDummyScript(function()
- --[[
- Author: @spotco
- This script creates sounds which are placed under the character head.
- These sounds are used by the "LocalSound" script.
- To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
- The default Sound script loaded for every character will then be replaced with your copy of the script.
- ]]--
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Players = game:GetService("Players")
- local SOUND_EVENT_FOLDER_NAME = "DefaultSoundEvents"
- local DEFAULT_SERVER_SOUND_EVENT_NAME = "DefaultServerSoundEvent"
- local SoundEventFolder = ReplicatedStorage:FindFirstChild(SOUND_EVENT_FOLDER_NAME)
- local DefaultServerSoundEvent = nil
- local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
- if useSoundDispatcher then
- if not SoundEventFolder then
- SoundEventFolder = Instance.new("Folder")
- SoundEventFolder.Name = SOUND_EVENT_FOLDER_NAME
- SoundEventFolder.Archivable = false
- SoundEventFolder.Parent = ReplicatedStorage
- end
- DefaultServerSoundEvent = SoundEventFolder:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
- else
- DefaultServerSoundEvent = ReplicatedStorage:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
- end
- if not DefaultServerSoundEvent then
- if useSoundDispatcher then
- DefaultServerSoundEvent = Instance.new("RemoteEvent", SoundEventFolder)
- else
- DefaultServerSoundEvent = Instance.new("RemoteEvent", ReplicatedStorage)
- end
- DefaultServerSoundEvent.Name = DEFAULT_SERVER_SOUND_EVENT_NAME
- DefaultServerSoundEvent.OnServerEvent:Connect(function() end)
- end
- local function CreateNewSound(name, id, looped, pitch, parent)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.Name = name
- sound.archivable = false
- sound.Pitch = pitch
- sound.Looped = looped
- sound.MinDistance = 5
- sound.MaxDistance = 150
- sound.Volume = 0.65
- sound.Parent = parent
- if DefaultServerSoundEvent then
- local CharacterSoundEvent = Instance.new("RemoteEvent", sound)
- CharacterSoundEvent.Name = "CharacterSoundEvent"
- CharacterSoundEvent.OnServerEvent:Connect(function(player, playing, resetPosition)
- if type(playing) ~= "boolean" then
- return
- end
- if type(resetPosition) ~= "boolean" then
- return
- end
- if player.Character ~= script.Parent then
- return
- end
- for _, p in pairs(Players:GetPlayers()) do
- if p ~= player then
- -- Connect to the dispatcher to check if the player has loaded.
- if useSoundDispatcher then
- SoundEventFolder:FindFirstChild("SoundDispatcher"):Fire(p, sound, playing, resetPosition)
- else
- DefaultServerSoundEvent:FireClient(p, sound, playing, resetPosition)
- end
- end
- end
- end)
- end
- return sound
- end
- local head = script.Parent:FindFirstChild("Head")
- if not head then
- error("Sound script parent has no child Head.")
- return
- end
- CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
- CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
- CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
- CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
- CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
- CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
- CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
- CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
- CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
- end,o71)
- o72.Name = "LocalSound"
- o72.Parent = o71
- runDummyScript(function()
- --[[
- Author: @spotco
- This script runs locally for the player of the given humanoid.
- This script triggers humanoid sound play/pause actions locally.
- The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
- immediately for the player and is replicated to all other players.
- This script is optimized to reduce network traffic through minimizing the amount of property replication.
- ]]--
- --All sounds are referenced by this ID
- local SFX = {
- Died = 0;
- Running = 1;
- Swimming = 2;
- Climbing = 3,
- Jumping = 4;
- GettingUp = 5;
- FreeFalling = 6;
- FallingDown = 7;
- Landing = 8;
- Splash = 9;
- }
- local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")
- local Humanoid = nil
- local Head = nil
- --SFX ID to Sound object
- local Sounds = {}
- local SoundService = game:GetService("SoundService")
- local soundEventFolderName = "DefaultSoundEvents"
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local AddCharacterLoadedEvent = nil
- local RemoveCharacterEvent = nil
- local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
- local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
- if useSoundDispatcher then
- if not soundEventFolder then
- soundEventFolder = Instance.new("Folder", ReplicatedStorage)
- soundEventFolder.Name = soundEventFolderName
- soundEventFolder.Archivable = false
- end
- -- Load the RemoveCharacterEvent
- RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
- if RemoveCharacterEvent == nil then
- RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
- RemoveCharacterEvent.Name = "RemoveCharacterEvent"
- end
- AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
- if AddCharacterLoadedEvent == nil then
- AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
- AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
- end
- -- Notify the server a new character has been loaded
- AddCharacterLoadedEvent:FireServer()
- -- Notify the sound dispatcher this character has left.
- game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
- RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
- end)
- end
- do
- local Figure = script.Parent.Parent
- Head = Figure:WaitForChild("Head")
- while not Humanoid do
- for _,NewHumanoid in pairs(Figure:GetChildren()) do
- if NewHumanoid:IsA("Humanoid") then
- Humanoid = NewHumanoid
- break
- end
- end
- if Humanoid then break end
- Figure.ChildAdded:wait()
- end
- Sounds[SFX.Died] = Head:WaitForChild("Died")
- Sounds[SFX.Running] = Head:WaitForChild("Running")
- Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
- Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
- Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
- Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
- Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
- Sounds[SFX.Landing] = Head:WaitForChild("Landing")
- Sounds[SFX.Splash] = Head:WaitForChild("Splash")
- local DefaultServerSoundEvent = nil
- if useSoundDispatcher then
- DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
- else
- DefaultServerSoundEvent = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent")
- end
- if DefaultServerSoundEvent then
- DefaultServerSoundEvent.OnClientEvent:connect(function(sound, playing, resetPosition)
- if resetPosition and sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- if sound.IsPlaying ~= playing then
- sound.Playing = playing
- end
- end)
- end
- end
- local IsSoundFilteringEnabled = function()
- return game.Workspace.FilteringEnabled and SoundService.RespectFilteringEnabled
- end
- local Util
- Util = {
- --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
- YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
- --(y - y1)/(x - x1) = m
- local m = (pt1y - pt2y) / (pt1x - pt2x)
- --float b = pt1.y - m * pt1.x;
- local b = (pt1y - m * pt1x)
- return m * x + b
- end;
- --Clamps the value of "val" between the "min" and "max"
- Clamp = function(val,min,max)
- return math.min(max,math.max(min,val))
- end;
- --Gets the horizontal (x,z) velocity magnitude of the given part
- HorizontalSpeed = function(Head)
- local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
- return hVel.magnitude
- end;
- --Gets the vertical (y) velocity magnitude of the given part
- VerticalSpeed = function(Head)
- return math.abs(Head.Velocity.Y)
- end;
- --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
- --If these properties are enabled, use them.
- Play = function(sound)
- if IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(true, true)
- end
- if sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- if not sound.IsPlaying then
- sound.Playing = true
- end
- end;
- Pause = function(sound)
- if IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(false, false)
- end
- if sound.IsPlaying then
- sound.Playing = false
- end
- end;
- Resume = function(sound)
- if IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(true, false)
- end
- if not sound.IsPlaying then
- sound.Playing = true
- end
- end;
- Stop = function(sound)
- if IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(false, true)
- end
- if sound.IsPlaying then
- sound.Playing = false
- end
- if sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- end;
- }
- do
- -- List of all active Looped sounds
- local playingLoopedSounds = {}
- -- Last seen Enum.HumanoidStateType
- local activeState = nil
- local fallSpeed = 0
- -- Verify and set that "sound" is in "playingLoopedSounds".
- function setSoundInPlayingLoopedSounds(sound)
- for i=1, #playingLoopedSounds do
- if playingLoopedSounds[i] == sound then
- return
- end
- end
- table.insert(playingLoopedSounds,sound)
- end
- -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
- function stopPlayingLoopedSoundsExcept(except)
- for i=#playingLoopedSounds,1,-1 do
- if playingLoopedSounds[i] ~= except then
- Util.Pause(playingLoopedSounds[i])
- table.remove(playingLoopedSounds,i)
- end
- end
- end
- -- Table of Enum.HumanoidStateType to handling function
- local stateUpdateHandler = {
- [Enum.HumanoidStateType.Dead] = function()
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.Died]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.RunningNoPhysics] = function(speed)
- stateUpdated(Enum.HumanoidStateType.Running, speed)
- end;
- [Enum.HumanoidStateType.Running] = function(speed)
- local sound = Sounds[SFX.Running]
- stopPlayingLoopedSoundsExcept(sound)
- if(useUpdatedLocalSoundFlag and activeState == Enum.HumanoidStateType.Freefall and fallSpeed > 0.1) then
- -- Play a landing sound if the character dropped from a large distance
- local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
- local freeFallSound = Sounds[SFX.FreeFalling]
- freeFallSound.Volume = vol
- Util.Play(freeFallSound)
- fallSpeed = 0
- end
- if useUpdatedLocalSoundFlag then
- if speed ~= nil and speed > 0.5 then
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- elseif speed ~= nil then
- stopPlayingLoopedSoundsExcept()
- end
- else
- if Util.HorizontalSpeed(Head) > 0.5 then
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- else
- stopPlayingLoopedSoundsExcept()
- end
- end
- end;
- [Enum.HumanoidStateType.Swimming] = function(speed)
- local threshold
- if useUpdatedLocalSoundFlag then threshold = speed else threshold = Util.VerticalSpeed(Head) end
- if activeState ~= Enum.HumanoidStateType.Swimming and threshold > 0.1 then
- local splashSound = Sounds[SFX.Splash]
- splashSound.Volume = Util.Clamp(
- Util.YForLineGivenXAndTwoPts(
- Util.VerticalSpeed(Head),
- 100, 0.28,
- 350, 1),
- 0,1)
- Util.Play(splashSound)
- end
- do
- local sound = Sounds[SFX.Swimming]
- stopPlayingLoopedSoundsExcept(sound)
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- end
- end;
- [Enum.HumanoidStateType.Climbing] = function(speed)
- local sound = Sounds[SFX.Climbing]
- if useUpdatedLocalSoundFlag then
- if speed ~= nil and math.abs(speed) > 0.1 then
- Util.Resume(sound)
- stopPlayingLoopedSoundsExcept(sound)
- else
- Util.Pause(sound)
- stopPlayingLoopedSoundsExcept(sound)
- end
- else
- if Util.VerticalSpeed(Head) > 0.1 then
- Util.Resume(sound)
- stopPlayingLoopedSoundsExcept(sound)
- else
- stopPlayingLoopedSoundsExcept()
- end
- end
- setSoundInPlayingLoopedSounds(sound)
- end;
- [Enum.HumanoidStateType.Jumping] = function()
- if activeState == Enum.HumanoidStateType.Jumping then
- return
- end
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.Jumping]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.GettingUp] = function()
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.GettingUp]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.Freefall] = function()
- if activeState == Enum.HumanoidStateType.Freefall then
- return
- end
- local sound = Sounds[SFX.FreeFalling]
- sound.Volume = 0
- stopPlayingLoopedSoundsExcept()
- fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.y))
- end;
- [Enum.HumanoidStateType.FallingDown] = function()
- stopPlayingLoopedSoundsExcept()
- end;
- [Enum.HumanoidStateType.Landed] = function()
- stopPlayingLoopedSoundsExcept()
- if Util.VerticalSpeed(Head) > 75 then
- local landingSound = Sounds[SFX.Landing]
- landingSound.Volume = Util.Clamp(
- Util.YForLineGivenXAndTwoPts(
- Util.VerticalSpeed(Head),
- 50, 0,
- 100, 1),
- 0,1)
- Util.Play(landingSound)
- end
- end;
- [Enum.HumanoidStateType.Seated] = function()
- stopPlayingLoopedSoundsExcept()
- end;
- }
- -- Handle state event fired or OnChange fired
- function stateUpdated(state, speed)
- if stateUpdateHandler[state] ~= nil then
- if useUpdatedLocalSoundFlag and (state == Enum.HumanoidStateType.Running
- or state == Enum.HumanoidStateType.Climbing
- or state == Enum.HumanoidStateType.Swimming
- or state == Enum.HumanoidStateType.RunningNoPhysics) then
- stateUpdateHandler[state](speed)
- else
- stateUpdateHandler[state]()
- end
- end
- activeState = state
- end
- Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
- Humanoid.Running:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Running, speed) end)
- Humanoid.Swimming:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Swimming, speed) end)
- Humanoid.Climbing:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Climbing, speed) end)
- Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
- Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
- Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
- Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
- -- required for proper handling of Landed event
- Humanoid.StateChanged:connect(function(old, new)
- stateUpdated(new)
- end)
- function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
- local stepScale = stepDeltaSeconds / tickSpeedSeconds
- do
- local sound = Sounds[SFX.FreeFalling]
- if activeState == Enum.HumanoidStateType.Freefall then
- if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
- Util.Resume(sound)
- --Volume takes 1.1 seconds to go from volume 0 to 1
- local ANIMATION_LENGTH_SECONDS = 1.1
- local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
- sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
- else
- sound.Volume = 0
- end
- else
- Util.Pause(sound)
- end
- end
- do
- local sound = Sounds[SFX.Running]
- if activeState == Enum.HumanoidStateType.Running then
- if Util.HorizontalSpeed(Head) < 0.5 then
- Util.Pause(sound)
- end
- end
- end
- end
- local lastTick = tick()
- local TICK_SPEED_SECONDS = 0.25
- while true do
- onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
- lastTick = tick()
- wait(TICK_SPEED_SECONDS)
- end
- end
- end,o72)
- o73.Name = "Health"
- o73.Parent = o14
- runDummyScript(function()
- -- Gradually regenerates the Humanoid's Health over time.
- local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
- local REGEN_STEP = 1 -- Wait this long between each regeneration step.
- --------------------------------------------------------------------------------
- local Character = script.Parent
- local Humanoid = Character:WaitForChild'Humanoid'
- --------------------------------------------------------------------------------
- while true do
- while Humanoid.Health < Humanoid.MaxHealth do
- local dt = wait(REGEN_STEP)
- local dh = dt*REGEN_RATE*Humanoid.MaxHealth
- Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
- end
- Humanoid.HealthChanged:Wait()
- end
- end,o73)
- o74.Name = "Animate"
- o74.Parent = o14
- runDummyScript(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=180435571", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=180426354", 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,o74)
- o75.Name = "idle"
- o75.Parent = o74
- o76.Name = "Animation1"
- o76.Parent = o75
- o76.AnimationId = "http://www.roblox.com/asset/?id=180435571"
- o77.Name = "Weight"
- o77.Parent = o76
- o77.Value = 9
- o78.Name = "Animation2"
- o78.Parent = o75
- o78.AnimationId = "http://www.roblox.com/asset/?id=180435792"
- o79.Name = "Weight"
- o79.Parent = o78
- o79.Value = 1
- o80.Name = "walk"
- o80.Parent = o74
- o81.Name = "WalkAnim"
- o81.Parent = o80
- o81.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- o82.Name = "run"
- o82.Parent = o74
- o83.Name = "RunAnim"
- o83.Parent = o82
- o83.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- o84.Name = "jump"
- o84.Parent = o74
- o85.Name = "JumpAnim"
- o85.Parent = o84
- o85.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- o86.Name = "climb"
- o86.Parent = o74
- o87.Name = "ClimbAnim"
- o87.Parent = o86
- o87.AnimationId = "http://www.roblox.com/asset/?id=180436334"
- o88.Name = "toolnone"
- o88.Parent = o74
- o89.Name = "ToolNoneAnim"
- o89.Parent = o88
- o89.AnimationId = "http://www.roblox.com/asset/?id=182393478"
- o90.Name = "fall"
- o90.Parent = o74
- o91.Name = "FallAnim"
- o91.Parent = o90
- o91.AnimationId = "http://www.roblox.com/asset/?id=180436148"
- o92.Name = "sit"
- o92.Parent = o74
- o93.Name = "SitAnim"
- o93.Parent = o92
- o93.AnimationId = "http://www.roblox.com/asset/?id=178130996"
- o94.Name = "ScaleDampeningPercent"
- o94.Parent = o74
- o94.Value = 0.39999997615814
- o95.Parent = o14
- o95.HeadColor = BrickColor.new("Pastel brown")
- o95.LeftArmColor = BrickColor.new("Pastel brown")
- o95.LeftLegColor = BrickColor.new("Pastel brown")
- o95.RightArmColor = BrickColor.new("Pastel brown")
- o95.RightLegColor = BrickColor.new("Pastel brown")
- o95.TorsoColor = BrickColor.new("Pastel brown")
- o96.Name = "Pants"
- o96.Parent = o14
- o96.PantsTemplate = "http://www.roblox.com/asset/?id=1439542143"
- o98.Name = "Handle"
- o98.Parent = mas
- o98.Position = Vector3.new(-24.0806046, 6.87327433, 40.703331)
- o98.Rotation = Vector3.new(-0.239999995, -34.9300003, -0.140000001)
- o98.CanCollide = false
- o98.Locked = true
- o98.FormFactor = Enum.FormFactor.Custom
- o98.Size = Vector3.new(1.45002651, 2.35999823, 1.24000001)
- o98.CFrame = CFrame.new(-24.0806046, 6.87327433, 40.703331, 0.81987673, 0.00198863354, -0.572536647, -1.19155866e-05, 0.99999404, 0.00345628988, 0.572540045, -0.00282691, 0.819871843)
- o98.BottomSurface = Enum.SurfaceType.Smooth
- o98.TopSurface = Enum.SurfaceType.Smooth
- o98.Position = Vector3.new(-24.0806046, 6.87327433, 40.703331)
- o99.Parent = o98
- o99.MeshId = "http://www.roblox.com/asset/?id=188565062 "
- o99.TextureId = "http://www.roblox.com/asset/?id=188565095 "
- o99.MeshType = Enum.MeshType.FileMesh
- o101.Name = "OriginalSize"
- o101.Parent = o98
- o101.Value = Vector3.new(1.45002651, 2.35999823, 1.24000001)
- o102.Name = "AccessoryWeld"
- o102.Parent = o98
- o102.C0 = CFrame.new(8.65748007e-09, 0.199999809, -0.0252722446, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o102.C1 = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o102.Part0 = o98
- o102.Part1 = o15
- o103.Name = "Shirt"
- o103.Parent = o14
- o103.ShirtTemplate = "http://www.roblox.com/asset/?id=1439532842"
- 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
- mess_handle.Text = "Resetting"
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- v:LoadCharacter()
- end
- wait(1)
- mess_handle:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement