Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"))
- Script0 = Instance.new("Script")
- Script1 = Instance.new("Script")
- LocalScript2 = Instance.new("LocalScript")
- Script3 = Instance.new("Script")
- NumberValue4 = Instance.new("NumberValue")
- ScreenGui5 = Instance.new("ScreenGui")
- LocalScript6 = Instance.new("LocalScript")
- Backpack7 = Instance.new("Backpack")
- TextButton8 = Instance.new("TextButton")
- TextLabel9 = Instance.new("TextLabel")
- TextLabel10 = Instance.new("TextLabel")
- Frame11 = Instance.new("Frame")
- Frame12 = Instance.new("Frame")
- TextButton13 = Instance.new("TextButton")
- TextBox14 = Instance.new("TextBox")
- NumberValue15 = Instance.new("NumberValue")
- Script0.Parent = mas
- Script1.Name = "Animations"
- Script1.Parent = Script0
- table.insert(cors,sandbox(Script1,function()
- game.Players.PlayerAdded:connect(function(plr)
- plr.CharacterAdded:connect(function(char)
- char:WaitForChild("Animate")
- char.Animate:Destroy()
- local a=script.Animate2:Clone()
- a.Parent=char
- end)
- end)
- end))
- LocalScript2.Name = "Animate2"
- LocalScript2.Parent = Script1
- table.insert(cors,sandbox(LocalScript2,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
- -- ANIMATION
- -- declarations
- 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 toolAnim = "None"
- local toolAnimTime = 0
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function onRunning(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- pose = "Jumping"
- end
- function onClimbing()
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- 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 moveJump()
- RightShoulder.MaxVelocity = jumpMaxLimbVelocity
- LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
- RightShoulder:SetDesiredAngle(3.14)
- LeftShoulder:SetDesiredAngle(-3.14)
- RightHip:SetDesiredAngle(0)
- LeftHip:SetDesiredAngle(0)
- end
- -- same as jump for now
- function moveFreeFall()
- RightShoulder.MaxVelocity = jumpMaxLimbVelocity
- LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
- RightShoulder:SetDesiredAngle(3.14)
- LeftShoulder:SetDesiredAngle(-3.14)
- RightHip:SetDesiredAngle(0)
- LeftHip:SetDesiredAngle(0)
- 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
- 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
- RightShoulder:SetDesiredAngle(1.57)
- return
- end
- if (toolAnim == "Slash") then
- RightShoulder.MaxVelocity = 0.5
- RightShoulder:SetDesiredAngle(0)
- return
- end
- if (toolAnim == "Lunge") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightHip.MaxVelocity = 0.5
- LeftHip.MaxVelocity = 0.5
- RightShoulder:SetDesiredAngle(1.57)
- LeftShoulder:SetDesiredAngle(1.0)
- RightHip:SetDesiredAngle(1.57)
- LeftHip:SetDesiredAngle(1.0)
- return
- end
- end
- function move(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- local climbFudge = 0
- if (pose == "Running") then
- if (RightShoulder.CurrentAngle > 1.5 or RightShoulder.CurrentAngle < -1.5) then
- RightShoulder.MaxVelocity = jumpMaxLimbVelocity
- else
- RightShoulder.MaxVelocity = 0.15
- end
- if (LeftShoulder.CurrentAngle > 1.5 or LeftShoulder.CurrentAngle < -1.5) then
- LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
- else
- LeftShoulder.MaxVelocity = 0.15
- end
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- amplitude = 1
- frequency = 9
- climbFudge = 3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- 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
- 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");
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- Script3.Name = "ClassicEngine/Chat"
- Script3.Parent = Script0
- table.insert(cors,sandbox(Script3,function()
- --Script made by EkoGam3.
- c = script.ClassicChat:clone()
- c.Parent = game.StarterGui
- c.Year = script.Year.Value
- script:Destroy()
- end))
- NumberValue4.Name = "Year"
- NumberValue4.Parent = Script3
- NumberValue4.Value = 2012
- ScreenGui5.Name = "ClassicChat"
- ScreenGui5.Parent = Script3
- LocalScript6.Name = "ChatScript"
- LocalScript6.Parent = ScreenGui5
- table.insert(cors,sandbox(LocalScript6,function()
- --Script modified by EkoGam3.
- --Concept credit goes to Vermis.
- local year = script.Parent:WaitForChild("Year").Value
- --Code
- if year == 2007 then
- script.Parent.ClickToChat.TextColor3 = Color3.new(0, 0, 0)
- script.Parent.ChatBar.BackgroundColor3 = Color3.new(255/255, 255/255, 255/255)
- end
- local Chat = {
- ChatColors = {
- BrickColor.new("Bright red"),
- BrickColor.new("Bright blue"),
- BrickColor.new("Earth green"),
- BrickColor.new("Bright violet"),
- BrickColor.new("Bright orange"),
- BrickColor.new("Bright yellow"),
- BrickColor.new("Light reddish violet"),
- BrickColor.new("Brick yellow"),
- };
- Gui = nil,
- Frame = nil,
- RenderFrame = nil,
- TapToChatLabel = nil,
- ClickToChatButton = nil,
- Templates = nil,
- EventListener = nil,
- MessageQueue = {},
- Configuration = {
- FontSize = Enum.FontSize.Size12,
- NumFontSize = 12,
- HistoryLength = 20,
- Size = UDim2.new(0.38, 0, 0.20, 0),
- MessageColor = Color3.new(1, 1, 1),
- AdminMessageColor = Color3.new(1, 215/255, 0),
- XScale = 0.025,
- LifeTime = 45,
- Position = UDim2.new(0, 2, 0.05, 0),
- DefaultTweenSpeed = 0.15,
- };
- CachedSpaceStrings_List = {},
- Messages_List = {},
- MessageThread = nil,
- TempSpaceLabel = nil,
- }
- function GetNameValue(pName)
- local value = 0
- for index = 1, #pName do
- local cValue = string.byte(string.sub(pName, index, index))
- local reverseIndex = #pName - index + 1
- if #pName%2 == 1 then
- reverseIndex = reverseIndex - 1
- end
- if reverseIndex%4 >= 2 then
- cValue = -cValue
- end
- value = value + cValue
- end
- return value%8
- end
- function Chat:ComputeChatColor(pName)
- return self.ChatColors[GetNameValue(pName) + 1].Color
- end
- function Chat:UpdateQueue(field, diff)
- for i = #self.MessageQueue, 1, -1 do
- if self.MessageQueue[i] then
- for _, label in pairs(self.MessageQueue[i]) do
- if label and type(label) ~= "table" and type(label) ~= "number" then
- if label:IsA("TextLabel") or label:IsA("TextButton") then
- if diff then
- label.Position = label.Position - UDim2.new(0, 0, diff, 0)
- else
- if field == self.MessageQueue[i] then
- label.Position = UDim2.new(self.Configuration.XScale, 0, label.Position.Y.Scale - field["Message"].Size.Y.Scale , 0)
- else
- label.Position = UDim2.new(self.Configuration.XScale, 0, label.Position.Y.Scale - field["Message"].Size.Y.Scale, 0)
- end
- if label.Position.Y.Scale < -0.01 then
- label.Visible = false
- label:Destroy()
- end
- end
- end
- end
- end
- end
- end
- end
- function Chat:ComputeSpaceString(pLabel)
- local nString = " "
- if not self.TempSpaceLabel then
- self.TempSpaceLabel = self.Templates.SpaceButton
- self.TempSpaceLabel.Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y);
- end
- self.TempSpaceLabel.Text = nString
- while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do
- nString = nString .. " "
- self.TempSpaceLabel.Text = nString
- end
- nString = nString .. " "
- self.CachedSpaceStrings_List[pLabel.Text] = nString
- self.TempSpaceLabel.Text = ""
- return nString
- end
- function Chat:UpdateChat(cPlayer, message)
- local messageField = {["Player"] = cPlayer,["Message"] = message}
- if coroutine.status(Chat.MessageThread) == "dead" then
- table.insert(Chat.Messages_List, messageField)
- Chat.MessageThread = coroutine.create(function ()
- for i = 1, #Chat.Messages_List do
- local field = Chat.Messages_List[i]
- Chat:CreateMessage(field["Player"], field["Message"])
- end
- Chat.Messages_List = {}
- end)
- coroutine.resume(Chat.MessageThread)
- else
- table.insert(Chat.Messages_List, messageField)
- end
- end
- function Chat:CreateMessage(cPlayer, message)
- local pName = cPlayer ~= nil and cPlayer.Name or "GAME"
- message = message:gsub("^%s*(.-)%s*$", "%1")
- self.MessageQueue[#self.MessageQueue] = (#self.MessageQueue > self.Configuration.HistoryLength) and nil or self.MessageQueue[#self.MessageQueue]
- local pLabel = self.Templates.pLabel:clone()
- pLabel.Name = pName;
- pLabel.Text = pName .. ";";
- pLabel.Parent = self.RenderFrame;
- pLabel.TextColor3 = (cPlayer.Neutral) and Chat:ComputeChatColor(pName) or cPlayer.TeamColor.Color
- local nString = self.CachedSpaceStrings_List[pName] or Chat:ComputeSpaceString(pLabel)
- local mLabel = self.Templates.mLabel:clone()
- mLabel.Name = pName .. " - message";
- mLabel.TextColor3 = Chat.Configuration.MessageColor;
- mLabel.Text = nString .. message;
- mLabel.Parent = self.RenderFrame;
- local heightField = mLabel.TextBounds.Y
- mLabel.Size = UDim2.new(1, 0, heightField/self.RenderFrame.AbsoluteSize.Y, 0)
- pLabel.Size = mLabel.Size
- local yPixels = self.RenderFrame.AbsoluteSize.Y
- local yFieldSize = mLabel.TextBounds.Y
- local queueField = {}
- queueField["Player"] = pLabel
- queueField["Message"] = mLabel
- queueField["SpawnTime"] = tick()
- table.insert(self.MessageQueue, 1, queueField)
- Chat:UpdateQueue(queueField)
- end
- function Chat:CreateChatBar()
- self.ClickToChatButton = self.Gui:WaitForChild("ClickToChat")
- self.ChatBar = self.Gui:WaitForChild("ChatBar")
- local mouse = game.Players.LocalPlayer:GetMouse()
- mouse.KeyDown:connect(function (key)
- if key:byte() == 47 or key == "/" then
- self.ClickToChatButton.Visible = false
- if year > 2007 then
- self.ChatBar.BackgroundColor3 = Color3.new(255/255, 255/255, 255/255)
- end
- self.ChatBar:CaptureFocus()
- end
- end)
- self.ClickToChatButton.MouseButton1Click:connect(function ()
- self.ClickToChatButton.Visible = false
- if year > 2007 then
- self.ChatBar.BackgroundColor3 = Color3.new(255/255, 255/255, 255/255)
- end
- self.ChatBar:CaptureFocus()
- end)
- end
- function Chat:PlayerChat(message)
- local m = Instance.new("StringValue")
- m.Name = "NewMessage"
- m.Value = message
- m.Parent = game.Players.LocalPlayer
- game:GetService("Debris"):AddItem(m, 2)
- end
- function Chat:CreateGui()
- self.Gui = script.Parent
- self.Frame = self.Gui:WaitForChild("ChatFrame")
- self.RenderFrame = self.Frame:WaitForChild("ChatRenderFrame")
- self.Templates = self.Gui:WaitForChild("Templates")
- Chat:CreateChatBar()
- self.ChatBar.FocusLost:connect(function(enterPressed)
- if year > 2007 then
- self.ChatBar.BackgroundColor3 = Color3.new(64/255, 64/255, 64/255)
- end
- if enterPressed and self.ChatBar.Text ~= "" then
- local cText = self.ChatBar.Text
- if string.sub(self.ChatBar.Text, 1, 1) == "%" then
- cText = "(TEAM) " .. string.sub(cText, 2, #cText)
- end
- Chat:PlayerChat(cText)
- if self.ClickToChatButton then
- self.ClickToChatButton.Visible = true
- end
- self.ChatBar.Text = ""
- self.ClickToChatButton.Visible = true
- end
- end)
- end
- function Chat:TrackPlayerChats()
- local function chatRegister(p)
- p.ChildAdded:connect(function (obj)
- if obj:IsA("StringValue") and obj.Name == "NewMessage" then
- if game.Players.LocalPlayer.Neutral or p.TeamColor == game.Players.LocalPlayer.TeamColor then
- Chat:UpdateChat(p, obj.Value)
- end
- end
- end)
- end
- for _,v in pairs(game.Players:GetPlayers()) do
- chatRegister(v)
- end
- game.Players.PlayerAdded:connect(chatRegister)
- end
- function Chat:CullThread()
- Spawn(function ()
- while true do
- if #self.MessageQueue > 0 then
- for _, field in pairs(self.MessageQueue) do
- if field["SpawnTime"] and field["Player"] and field["Message"] and tick() - field["SpawnTime"] > self.Configuration.LifeTime then
- field["Player"].Visible = false
- field["Message"].Visible = false
- end
- end
- end
- wait(5)
- end
- end)
- end
- function Chat:Initialize()
- Chat:CreateGui()
- Chat:TrackPlayerChats()
- self.MessageThread = coroutine.create(function () end)
- coroutine.resume(self.MessageThread)
- Chat:CullThread()
- end
- Chat:Initialize()
- end))
- Backpack7.Name = "Templates"
- Backpack7.Parent = ScreenGui5
- TextButton8.Name = "SpaceButton"
- TextButton8.Parent = Backpack7
- TextButton8.Size = UDim2.new(0, 510, 0, 12)
- TextButton8.BackgroundColor = BrickColor.new("Oyster")
- TextButton8.BackgroundColor3 = Color3.new(0.698039, 0.698039, 0.698039)
- TextButton8.BackgroundTransparency = 1
- TextButton8.AutoButtonColor = false
- TextButton8.FontSize = Enum.FontSize.Size12
- TextButton8.Text = ""
- TextButton8.TextSize = 12
- TextLabel9.Name = "mLabel"
- TextLabel9.Parent = Backpack7
- TextLabel9.Position = UDim2.new(0, 0, 1, 0)
- TextLabel9.Size = UDim2.new(1, 0, 0.5, 0)
- TextLabel9.BackgroundColor = BrickColor.new("Oyster")
- TextLabel9.BackgroundColor3 = Color3.new(0.698039, 0.698039, 0.698039)
- TextLabel9.BackgroundTransparency = 1
- TextLabel9.BorderSizePixel = 0
- TextLabel9.FontSize = Enum.FontSize.Size12
- TextLabel9.Text = ""
- TextLabel9.TextSize = 12
- TextLabel9.TextWrap = true
- TextLabel9.TextWrapped = true
- TextLabel9.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel9.TextYAlignment = Enum.TextYAlignment.Top
- TextLabel10.Name = "pLabel"
- TextLabel10.Parent = Backpack7
- TextLabel10.Position = UDim2.new(0, 0, 1, 0)
- TextLabel10.Size = UDim2.new(1, 0, 0.100000001, 0)
- TextLabel10.BackgroundColor = BrickColor.new("Oyster")
- TextLabel10.BackgroundColor3 = Color3.new(0.698039, 0.698039, 0.698039)
- TextLabel10.BackgroundTransparency = 1
- TextLabel10.BorderSizePixel = 0
- TextLabel10.ZIndex = 2
- TextLabel10.FontSize = Enum.FontSize.Size12
- TextLabel10.Text = "Player: "
- TextLabel10.TextSize = 12
- TextLabel10.TextStrokeColor3 = Color3.new(0.501961, 0.501961, 0.501961)
- TextLabel10.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel10.TextYAlignment = Enum.TextYAlignment.Top
- Frame11.Name = "ChatFrame"
- Frame11.Parent = ScreenGui5
- Frame11.Position = UDim2.new(0, 5, 0, 10)
- Frame11.Size = UDim2.new(0, 500, 0, 120)
- Frame11.BackgroundColor = BrickColor.new("Oyster")
- Frame11.BackgroundColor3 = Color3.new(0.698039, 0.698039, 0.698039)
- Frame11.BackgroundTransparency = 1
- Frame11.BorderColor = BrickColor.new("Really black")
- Frame11.BorderColor3 = Color3.new(0, 0, 0)
- Frame11.BorderSizePixel = 0
- Frame11.ZIndex = 9
- Frame12.Name = "ChatRenderFrame"
- Frame12.Parent = Frame11
- Frame12.Size = UDim2.new(1.01999998, 0, 1.00999999, 0)
- Frame12.BackgroundColor = BrickColor.new("Oyster")
- Frame12.BackgroundColor3 = Color3.new(0.698039, 0.698039, 0.698039)
- Frame12.BackgroundTransparency = 1
- Frame12.BorderColor = BrickColor.new("Really black")
- Frame12.BorderColor3 = Color3.new(0, 0, 0)
- Frame12.BorderSizePixel = 0
- Frame12.ZIndex = 9
- TextButton13.Name = "ClickToChat"
- TextButton13.Parent = ScreenGui5
- TextButton13.Position = UDim2.new(0, 0, 1, -20)
- TextButton13.Size = UDim2.new(1, 0, 0, 20)
- TextButton13.BackgroundColor = BrickColor.new("Institutional white")
- TextButton13.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton13.BackgroundTransparency = 1
- TextButton13.BorderColor = BrickColor.new("Really black")
- TextButton13.BorderColor3 = Color3.new(0, 0, 0)
- TextButton13.BorderSizePixel = 0
- TextButton13.ZIndex = 9
- TextButton13.AutoButtonColor = false
- TextButton13.Font = Enum.Font.SourceSansBold
- TextButton13.FontSize = Enum.FontSize.Size14
- TextButton13.Text = "To chat click here or press the "/" key"
- TextButton13.TextColor = BrickColor.new("Buttermilk")
- TextButton13.TextColor3 = Color3.new(1, 0.980392, 0.72549)
- TextButton13.TextSize = 14
- TextButton13.TextXAlignment = Enum.TextXAlignment.Left
- TextBox14.Name = "ChatBar"
- TextBox14.Parent = ScreenGui5
- TextBox14.Position = UDim2.new(0, 0, 1, -20)
- TextBox14.Size = UDim2.new(1, 0, 0, 20)
- TextBox14.BackgroundColor = BrickColor.new("Black")
- TextBox14.BackgroundColor3 = Color3.new(0.211765, 0.211765, 0.211765)
- TextBox14.BorderColor = BrickColor.new("Really black")
- TextBox14.BorderColor3 = Color3.new(0, 0, 0)
- TextBox14.BorderSizePixel = 0
- TextBox14.ZIndex = 8
- TextBox14.FontSize = Enum.FontSize.Size12
- TextBox14.Text = ""
- TextBox14.TextColor = BrickColor.new("Really black")
- TextBox14.TextColor3 = Color3.new(0, 0, 0)
- TextBox14.TextSize = 12
- TextBox14.TextXAlignment = Enum.TextXAlignment.Left
- TextBox14.ClearTextOnFocus = false
- NumberValue15.Name = "Year"
- NumberValue15.Parent = ScreenGui5
- NumberValue15.Value = 2008
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement