Shift Client

 avatar
unknown
lua
2 years ago
4.6 kB
10
Indexable
local UIS = game:GetService("UserInputService")
local Storage = game:GetService("ReplicatedStorage"):WaitForChild("TitanOSReplicatedStorage")
local Remotes = Storage:WaitForChild("Remotes")

local player = game:GetService('Players').LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local CDMModule = require(Storage:WaitForChild("Modules"):WaitForChild("CoolDowns"))
local Tween = game:GetService("TweenService")
--TitanGuis ect.. later tho
local AnimationFolder = game:GetService("ReplicatedStorage"):WaitForChild("TitanOSReplicatedStorage"):WaitForChild("Animations"):WaitForChild("Character")
local Debounce = false

local function shade()
	local BlackLines = Instance.new("ScreenGui")
	BlackLines.Name = 'Lines'
	BlackLines.Parent = player.PlayerGui


	local Frame1 = Instance.new("Frame",BlackLines)
	Frame1.BackgroundColor3 = Color3.new(0,0,0)
	Frame1.Size = UDim2.new(1,0,.12,0)
	Frame1.Position = UDim2.new(0,0,-0.5,0)
	--Frame1.Rotation = 2
	task.wait()
	local Frame2 = Instance.new("Frame",BlackLines)
	Frame2.BackgroundColor3 = Color3.new(0,0,0)
	Frame2.Size = UDim2.new(1,0,.13,0)
	Frame2.Position = UDim2.new(0,0,1.3,0)
	--	Frame2.Rotation = 2

	task.wait()
	Frame1:TweenPosition(UDim2.new(0,0,-0.1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine)
	Frame2:TweenPosition(UDim2.new(0,0,.90,0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine)
	delay(5,function()
		Frame1:TweenPosition(UDim2.new(0,0,-0.5,0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine)
		Frame2:TweenPosition(UDim2.new(0,0,1.3,0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine)
		task.wait(1)
		Frame1:Destroy()
		Frame2:Destroy()
	end)
end


UIS.InputBegan:Connect(function(input,gpe)
	--if CDMModule.GetCooldown()  then return end
	if gpe then return end
	
	if input.KeyCode == Enum.KeyCode.F and not Debounce then
		Debounce = true
		task.delay(10,function()
			Debounce = false
		end)
		local Sound = Storage:WaitForChild("Sounds"):WaitForChild("Character"):WaitForChild("Bite"):Clone()
		local Extras = game.Workspace:FindFirstChild("Extras") or Instance.new("Folder",game.Workspace)

		Extras.Name = "Extras"
		local TitanInside = Storage:WaitForChild("Extra"):WaitForChild("TitanInside"):Clone()

		local IsAlive = Remotes:WaitForChild("IsAlive"):InvokeServer()
		local titanname = player:WaitForChild("PlayerGui"):FindFirstChild("TitanOsName",true).Text
		local filtered = string.gsub(titanname,"Titan: ","")
		
		--CDMModule.CreateCooldown(Storage:FindFirstChild(filtered,true))
		if not Storage:WaitForChild("Titans"):FindFirstChild(filtered,true) then warn("empty") Debounce = false return end
		

		
		if IsAlive then
			local Animation = AnimationFolder:WaitForChild("Ground")
			local humanoid = character.Humanoid
			local Animator = humanoid.Animator

			if humanoid.FloorMaterial == Enum.Material.Air then
				Animation = AnimationFolder:WaitForChild("Air")
			end


			local track = Animator:LoadAnimation(Animation)
			track:Play()
			character.PrimaryPart.Anchored = true
			local Debris = game:GetService("Debris")
			Sound.Parent = character
			Debris:AddItem(Sound,7)
			

			local Shift = Remotes:WaitForChild("Shift")
			local PreShift = Remotes:WaitForChild("PreShift")
			local sample = false
		local 	function Shifts()
				if sample then return end
				sample = true
				print('reach')
				shade()
			--	track:AdjustSpeed(.1)
				local IsAlive = Remotes:WaitForChild("IsAlive"):InvokeServer()
				if IsAlive then

					PreShift:FireServer(filtered)

					Sound:Play()
					task.wait(3)
					IsAlive = Remotes:WaitForChild("IsAlive"):InvokeServer()
					if IsAlive then
						task.delay(1,function()
							Shift:FireServer(filtered)
						end)
						if not Extras:FindFirstChild("TitanInside") then 
							TitanInside.PrimaryPart.Anchored = true
							TitanInside.Parent = Extras
							TitanInside.PrimaryPart.CFrame = CFrame.new(10000,100000,10000)
							local PlayerTitan = TitanInside:WaitForChild("Player")
							local Hum = PlayerTitan:WaitForChild("Humanoid")
							local Animator = Hum:WaitForChild("Animator")
							Animator:LoadAnimation(AnimationFolder:WaitForChild("Neck")):Play()
							local desc = game:GetService("Players"):GetHumanoidDescriptionFromUserId(player.UserId)
							Hum:ApplyDescription(desc,Enum.AssetTypeVerification.ClientOnly)
							print('good')
						end

					end

				end
			end
			task.delay(1,Shifts)
			track:GetMarkerReachedSignal("Bit"):Connect(Shift)
		else
			print("died")
			return

		end

		
	end

end)
Editor is loading...