Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[ The Module ]]

--
local BaseCharacterController = {}
BaseCharacterController.__index = BaseCharacterController

function BaseCharacterController.new()
	local self = setmetatable({}, BaseCharacterController)
	self.enabled = false
	self.moveVector = ZERO_VECTOR3
	self.moveVectorIsCameraRelative = true
	self.isJumping = false
	return self
end

function BaseCharacterController:OnRenderStepped(dt: number)
	-- By default, nothing to do
end

function BaseCharacterController:GetMoveVector(): Vector3
	return self.moveVector
end

function BaseCharacterController:IsMoveVectorCameraRelative(): boolean
	return self.moveVectorIsCameraRelative
end

function BaseCharacterController:GetIsJumping(): boolean
	return self.isJumping
end
--!strict
-- ROBLOX deviation: Promote `shared` to an actual unpublished package with a
-- real interface instead of just a bag of loose source code


local Packages = script.Parent
local LuauPolyfill = require(Packages.LuauPolyfill)
type Object = LuauPolyfill.Object

local ReactTypes = require(script.ReactTypes)
local flowtypes = require(script["flowtypes.roblox"])
local ReactElementType = require(script.ReactElementType)
local ReactFiberHostConfig = require(script.ReactFiberHostConfig)
local ReactSharedInternals = require(script.ReactSharedInternals)
local ErrorHandling = require(script["ErrorHandling.roblox"])
--//Despawning\\--


function DestroyCorpseOnDeath(Model)
	repeat wait() until Model:FindFirstChildOfClass("Humanoid")
	local MaybeHuman = Model:FindFirstChildOfClass("Humanoid") 	
	if MaybeHuman then
		local HumanFunc
		HumanFunc=MaybeHuman.Died:Connect(function()
			for i,v in pairs(Model:GetDescendants()) do
				if v:IsA("Script") then
					v:Destroy()
				end
			end
			print("Death")
			local Done=false
			for i,v in pairs(Model:GetDescendants()) do
				if v:IsA("Part") or v:IsA("MeshPart") then
					spawn(function()
						for i =1,10 do
							wait(0.1)
							if v then
								v.Transparency=v.Transparency+.1
							else
								break
							end
						end
						v:Destroy()
						Done=true
					end)
				end
			end
			repeat wait() until Done==true
			if Model then
				Model:Destroy()
			end
			HumanFunc:Disconnect()
		end)
	end 
end
CurZombie=nil
--[=[
	Constructs a new Subscription

	@param fireCallback function?
	@param failCallback function?
	@param completeCallback function?
	@param onSubscribe () -> MaidTask
	@return Subscription
]=]


function Subscription.new(fireCallback, failCallback, completeCallback, onSubscribe)
	assert(type(fireCallback) == "function" or fireCallback == nil, "Bad fireCallback")
	assert(type(failCallback) == "function" or failCallback == nil, "Bad failCallback")
	assert(type(completeCallback) == "function" or completeCallback == nil, "Bad completeCallback")

	return setmetatable({
		_state = stateTypes.PENDING;
		_source = ENABLE_STACK_TRACING and debug.traceback() or "";
		_fireCallback = fireCallback;
		_failCallback = failCallback;
		_completeCallback = completeCallback;
		_onSubscribe = onSubscribe;
	}, Subscription)
end
--Made by Luckymaxer



Model = script.Parent

Debris = game:GetService("Debris")

Creator = script:FindFirstChild("Creator")
Tool = script:FindFirstChild("Tool")

FadeRate = 0.025
Rate = (1 / 15)

Removing = false

function DestroyModel()
	if Removing then
		return
	end
	Model.Name = ""
	for i, v in pairs(Model:GetChildren()) do
		if v:IsA("BasePart") then
			v.Transparency = 1
			v.Anchored = true
			v.CanCollide = false
			for ii, vv in pairs(v:GetChildren()) do
				if vv:IsA("Fire") or vv:IsA("Smoke") or vv:IsA("Sparkles") or vv:IsA("Light") or vv:IsA("ParticleEmitter") then
					vv.Enabled = false
				end
			end
		end
	end
	Removing = true
	Debris:AddItem(Model, 1.5)
end

function ClearModel()
	if Removing then
		return
	end
	local Parts = {}
	for i, v in pairs(Model:GetChildren()) do
		if v:IsA("BasePart") then
			table.insert(Parts, v)
		end
	end
	if #Parts == 0 then
		Removing = true
		Model.Name = ""
		Debris:AddItem(Model, 0.5)
	end
end

if not Creator or not Creator.Value or not Creator.Value:IsA("Player") or not Creator.Value.Parent or not Tool or not Tool.Value or not Tool.Value.Parent then
	DestroyModel()
	return
end

Creator = Creator.Value
Tool = Tool.Value

Character = Creator.Character
if not Character then
	DestroyModel()
	return
end

Creator.Changed:connect(function(Property)
	if Property == "Parent" and not Creator.Parent then
		DestroyModel()
	end
end)

Character.Changed:connect(function(Property)
	if Property == "Parent" and not Character.Parent then
		DestroyModel()
	end
end)

Tool.Changed:connect(function(Property)
	if Property == "Parent" then
		DestroyModel()
	end
end)

Model.ChildRemoved:connect(function(Child)
	ClearModel()
end)

wait(1)

ClearModel()
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================


local function exit()
	local raceStatus = RaceManager:GetRaceStatus()
	if raceStatus == RaceManager.Status.WaitingForPlayers or 
		raceStatus == RaceManager.Status.WaitingForRaceToStart then
		RemoveActivePlayer:FireServer()
	else
		PlayerConverter:SpeederToPlayer()
	end
end -- exit()
-- goro7



local plr = game.Players.LocalPlayer

function update()
	
	-- Calculate scale
	local scale = (plr.PlayerGui.MainGui.AbsoluteSize.Y + 2) / script.Parent.Parent.Size.Y.Offset
	if scale > 1.5 then
		scale = 1.5
	end
	if scale > 0 then
		script.Parent.Scale = scale
	end
	
end

plr.PlayerGui:WaitForChild("MainGui"):GetPropertyChangedSignal("AbsoluteSize"):connect(update)
update()
--[[
	For each point on each line, find the values of the other sequence at that point in time through interpolation
		then interpolate between the known value and the learned value
		then use that value to create a new keypoint at the time
		then build a new sequence using all the keypoints generated
--]]



local sortByTime = function(a, b)
	return a.Time < b.Time
end

return function(a, b, t)
	local keypoints = {}
	local addedTimes = {}
	
	for i, ap in next, a.Keypoints do
		local closestAbove, closestBelow
		
		for i, bp in next, b.Keypoints do
			if bp.Time == ap.Time then
				closestAbove, closestBelow = bp, bp
				break
			elseif bp.Time < ap.Time and (closestBelow == nil or bp.Time > closestBelow.Time) then
				closestBelow = bp
			elseif bp.Time > ap.Time and (closestAbove == nil or bp.Time < closestAbove.Time) then
				closestAbove = bp
			end
		end
		
		local bValue, bEnvelope
		if closestAbove == closestBelow then
			bValue, bEnvelope = closestAbove.Value, closestAbove.Envelope
		else
			local p = (ap.Time - closestBelow.Time)/(closestAbove.Time - closestBelow.Time)
			bValue = (closestAbove.Value - closestBelow.Value)*p + closestBelow.Value
			bEnvelope = (closestAbove.Envelope - closestBelow.Envelope)*p + closestBelow.Envelope
		end
		local interValue = (bValue - ap.Value)*t + ap.Value
		local interEnvelope = (bEnvelope - ap.Envelope)*t + ap.Envelope
		local interp = NumberSequenceKeypoint.new(ap.Time, interValue, interEnvelope)
		
		table.insert(keypoints, interp)
		
		addedTimes[ap.Time] = true
	end
	for i, bp in next, b.Keypoints do
		if not addedTimes[bp.Time] then
			local closestAbove, closestBelow
			
			for i, ap in next, a.Keypoints do
				if ap.Time == bp.Time then
					closestAbove, closestBelow = ap, ap
					break
				elseif ap.Time < bp.Time and (closestBelow == nil or ap.Time > closestBelow.Time) then
					closestBelow = ap
				elseif ap.Time > bp.Time and (closestAbove == nil or ap.Time < closestAbove.Time) then
					closestAbove = ap
				end
			end
			
			local aValue, aEnvelope
			if closestAbove == closestBelow then
				aValue, aEnvelope = closestAbove.Value, closestAbove.Envelope
			else
				local p = (bp.Time - closestBelow.Time)/(closestAbove.Time - closestBelow.Time)
				aValue = (closestAbove.Value - closestBelow.Value)*p + closestBelow.Value
				aEnvelope = (closestAbove.Envelope - closestBelow.Envelope)*p + closestBelow.Envelope
			end
			local interValue = (bp.Value - aValue)*t + aValue
			local interEnvelope = (bp.Envelope - aEnvelope)*t + aEnvelope
			local interp = NumberSequenceKeypoint.new(bp.Time, interValue, interEnvelope)
			
			table.insert(keypoints, interp)
		end
	end
	
	table.sort(keypoints, sortByTime)
	
	return NumberSequence.new(keypoints)
end
--[=[
	@param matches {Some: (value: any) -> any, None: () -> any}
	@return any

	Matches against the option.

	```lua
	local opt = Option.Some(32)
	opt:Match {
		Some = function(num) print("Number", num) end,
		None = function() print("No value") end,
	}
	```
]=]


function Option:Match(matches)
	local onSome = matches.Some
	local onNone = matches.None
	assert(type(onSome) == "function", "Missing 'Some' match")
	assert(type(onNone) == "function", "Missing 'None' match")
	if self:IsSome() then
		return onSome(self:Unwrap())
	else
		return onNone()
	end
end
--////////////////////////////// Methods
--//////////////////////////////////////



local methods = {}
methods.__index = methods

function methods:SendSystemMessage(message, extraData)
	local messageObj = self:InternalCreateMessageObject(message, nil, true, extraData)

	local success, err = pcall(function() self.eMessagePosted:Fire(messageObj) end)
	if not success and err then
		print("Error posting message: " ..err)
	end

	self:InternalAddMessageToHistoryLog(messageObj)

	for i, speaker in pairs(self.Speakers) do
		speaker:InternalSendSystemMessage(messageObj, self.Name)
	end

	return messageObj
end

function methods:SendSystemMessageToSpeaker(message, speakerName, extraData)
	local speaker = self.Speakers[speakerName]
	if (speaker) then
		local messageObj = self:InternalCreateMessageObject(message, nil, true, extraData)
		speaker:InternalSendSystemMessage(messageObj, self.Name)
	else
		warn(string.format("Speaker '%s' is not in channel '%s' and cannot be sent a system message", speakerName, self.Name))
	end
end

function methods:SendMessageObjToFilters(message, messageObj, fromSpeaker)
	local oldMessage = messageObj.Message
	messageObj.Message = message
	self:InternalDoMessageFilter(fromSpeaker.Name, messageObj, self.Name)
	self.ChatService:InternalDoMessageFilter(fromSpeaker.Name, messageObj, self.Name)
	local newMessage = messageObj.Message
	messageObj.Message = oldMessage
	return newMessage
end

function methods:CanCommunicateByUserId(userId1, userId2)
--[[**
		creates a union type

		@param ... The checks to union

		@returns A function that will return true iff the condition is passed
	**--]]


	function t.union(...)
		local checks = { ... }
		assert(callbackArray(checks))

		return function(value)
			for _, check in ipairs(checks) do
				if check(value) then
					return true
				end
			end

			return false
		end
	end
--[[The local script included in this model can only be used if
1. The weapon is being placed in the players backpack first (i.e. the weapon is in starterpack and moves to player backpack)
OR
2. The weapon is previously welded (weapon can be placed in workspace and picked up then)
]]

 
repeat wait() until script.Parent:FindFirstChild("Handle")
local welds={}
function ClearOldWelds(tbl)
	for _,v in pairs(tbl) do
		if v:IsA('Weld') then
			v:Destroy()
		end
	end
end

function Equipped()
	local handle=script.Parent:FindFirstChild('Handle')
	if not handle then return end
	local tble=handle:GetChildren()
	for _,v in pairs(script.Parent:GetChildren()) do
		if v:IsA('BasePart') and v~=handle then
			local c1
			for _1,v1 in pairs(welds) do
				if _1==v then
					c1=v1
					break
				end
			end
			if not c1 then
				welds[v]=v.CFrame:inverse()*handle.CFrame
				v.Anchored=false
				c1=welds[v]
			end
			local weld=Instance.new('Weld')
					weld.Part0=handle
					weld.Part1=v
					weld.C0=CFrame.new()
					weld.C1=c1
					weld.Parent=handle
		end
	end
	ClearOldWelds(tble)
	handle.Anchored=false
end
Equipped()
script.Parent.Equipped:connect(Equipped)
--[=[
	Returns `true` if the property object is ready to be
	used. In other words, it has successfully gained
	connection to the server-side version and has synced
	in the initial value.

	```lua
	if clientRemoteProperty:IsReady() then
		local value = clientRemoteProperty:Get()
	end
	```
]=]


function ClientRemoteProperty:IsReady(): boolean
	return self._ready
end
------------------------------------------------------------------------
--
-- * used only in luaK:codearith()
------------------------------------------------------------------------


function luaK:constfolding(op, e1, e2)
  local r
  if not self:isnumeral(e1) or not self:isnumeral(e2) then return false end
  local v1 = e1.nval
  local v2 = e2.nval
  if op == "OP_ADD" then
    r = self:numadd(v1, v2)
  elseif op == "OP_SUB" then
    r = self:numsub(v1, v2)
  elseif op == "OP_MUL" then
    r = self:nummul(v1, v2)
  elseif op == "OP_DIV" then
    if v2 == 0 then return false end  -- do not attempt to divide by 0
    r = self:numdiv(v1, v2)
  elseif op == "OP_MOD" then
    if v2 == 0 then return false end  -- do not attempt to divide by 0
    r = self:nummod(v1, v2)
  elseif op == "OP_POW" then
    r = self:numpow(v1, v2)
  elseif op == "OP_UNM" then
    r = self:numunm(v1)
  elseif op == "OP_LEN" then
    return false  -- no constant folding for 'len'
  else
    assert(0)
    r = 0
  end
  if self:numisnan(r) then return false end  -- do not attempt to produce NaN
  e1.nval = r
  return true
end
-- Called when any relevant values of GameSettings or LocalPlayer change, forcing re-evalulation of
-- current control scheme


function ControlModule:OnComputerMovementModeChange()
	local controlModule, success =  self:SelectComputerMovementModule()
	if success then
		self:SwitchToController(controlModule)
	end
end

function ControlModule:OnTouchMovementModeChange()
	local touchModule, success = self:SelectTouchModule()
	if success then
		while not self.touchControlFrame do
			wait()
		end
		self:SwitchToController(touchModule)
	end
end

function ControlModule:CreateTouchGuiContainer()
	if self.touchGui then self.touchGui:Destroy() end

	-- Container for all touch device guis
	self.touchGui = Instance.new("ScreenGui")
	self.touchGui.Name = "TouchGui"
	self.touchGui.ResetOnSpawn = false
	self.touchGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
	self:UpdateTouchGuiVisibility()

	self.touchControlFrame = Instance.new("Frame")
	self.touchControlFrame.Name = "TouchControlFrame"
	self.touchControlFrame.Size = UDim2.new(1, 0, 1, 0)
	self.touchControlFrame.BackgroundTransparency = 1
	self.touchControlFrame.Parent = self.touchGui

	self.touchGui.Parent = self.playerGui
end

function ControlModule:GetClickToMoveController()
	if not self.controllers[ClickToMove] then
		self.controllers[ClickToMove] = ClickToMove.new(CONTROL_ACTION_PRIORITY)
	end
	return self.controllers[ClickToMove]
end

return ControlModule.new()
--[[
	@class ClientMain
]]



local ReplicatedFirst = game:GetService("ReplicatedFirst")

local packages = ReplicatedFirst:WaitForChild("_SoftShutdownClientPackages")

local SoftShutdownServiceClient = require(packages.SoftShutdownServiceClient)
local serviceBag = require(packages.ServiceBag).new()

serviceBag:GetService(SoftShutdownServiceClient)

serviceBag:Init()
serviceBag:Start()
--// This module is for stuff specific to cross server communication
--// NOTE: THIS IS NOT A *CONFIG/USER* PLUGIN! ANYTHING IN THE MAINMODULE PLUGIN FOLDERS IS ALREADY PART OF/LOADED BY THE SCRIPT! DO NOT ADD THEM TO YOUR CONFIG>PLUGINS FOLDER!


return function(Vargs, GetEnv)
	local env = GetEnv(nil, {script = script})
	setfenv(1, env)

	local server = Vargs.Server;
	local service = Vargs.Service;

	local Settings = server.Settings
	local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps =
		server.Functions, server.Commands, server.Admin, server.Anti, server.Core, server.HTTP, server.Logs, server.Remote, server.Process, server.Variables, server.Deps

	-- // Remove legacy trello board
	local epix_board_index = type(Settings.Trello_Secondary) == "table" and table.find(Settings.Trello_Secondary, "9HH6BEX2")
	if epix_board_index then
		table.remove(Settings.Trello_Secondary, epix_board_index)
		Logs:AddLog("Script", "Removed legacy trello board")
	end

	Logs:AddLog("Script", "Misc Features Module Loaded")
end
-- ================================================================================
-- EVENTS
-- ================================================================================


local buttonDown = Instance.new("BindableEvent")
local buttonUp = Instance.new("BindableEvent")
local changed = Instance.new("BindableEvent")
local connected = Instance.new("BindableEvent")
local disconnected = Instance.new("BindableEvent")

Gamepad.ButtonDown = buttonDown.Event
Gamepad.ButtonUp = buttonUp.Event
Gamepad.Changed = changed.Event
Gamepad.Connected = connected.Event
Gamepad.Disconnected = disconnected.Event
-- If in-game, enable ctrl hotkeys for undoing and redoing


if Mode == 'Tool' then
	AssignHotkey({ 'LeftControl', 'Z' }, History.Undo);
	AssignHotkey({ 'RightControl', 'Z' }, History.Undo);
	AssignHotkey({ 'LeftControl', 'Y' }, History.Redo);
	AssignHotkey({ 'RightControl', 'Y' }, History.Redo);
end;

local function GetDepthFromAncestor(Item, Ancestor)
	-- Returns the depth of `Item` from `Ancestor`

	local Depth = 0

	-- Go through ancestry until reaching `Ancestor`
	while Item ~= Ancestor do
		Depth = Depth + 1
		Item = Item.Parent
	end

	-- Return depth
	return Depth
end

local function GetHighestParent(Items)
	local HighestItem, HighestItemDepth

	-- Calculate depth of each item & keep highest
	for _, Item in ipairs(Items) do
		local Depth = GetDepthFromAncestor(Item, game)
		if (not HighestItemDepth) or (Depth < HighestItemDepth) then
			HighestItem = Item
			HighestItemDepth = Depth
		end
	end

	-- Return parent of highest item
	return HighestItem and HighestItem.Parent or nil
end

function CloneSelection()
	-- Clones selected parts

	-- Make sure that there are items in the selection
	if #Selection.Items == 0 then
		return;
	end;

	-- Send the cloning request to the server
	local Clones = SyncAPI:Invoke('Clone', Selection.Items, GetHighestParent(Selection.Items))

	-- Put together the history record
	local HistoryRecord = {
		Clones = Clones;

		Unapply = function (HistoryRecord)
			-- Reverts this change

			-- Deselect the clones
			Selection.Remove(HistoryRecord.Clones, false);

			-- Remove the clones
			SyncAPI:Invoke('Remove', HistoryRecord.Clones);

		end;

		Apply = function (HistoryRecord)
			-- Reapplies this change

			-- Restore the clones
			SyncAPI:Invoke('UndoRemove', HistoryRecord.Clones);

		end;

	};

	-- Register the history record
	History.Add(HistoryRecord);

	-- Select the clones
	Selection.Replace(Clones);

	-- Flash the outlines of the new parts
	coroutine.wrap(Selection.FlashOutlines)();

end;

function DeleteSelection()
	-- Deletes selected items

	-- Put together the history record
	local HistoryRecord = {
		Parts = Support.CloneTable(Selection.Items);

		Unapply = function (HistoryRecord)
			-- Reverts this change

			-- Restore the parts
			SyncAPI:Invoke('UndoRemove', HistoryRecord.Parts);

			-- Select the restored parts
			Selection.Replace(HistoryRecord.Parts);

		end;

		Apply = function (HistoryRecord)
			-- Applies this change

			-- Deselect the parts
			Selection.Remove(HistoryRecord.Parts, false);

			-- Remove the parts
			SyncAPI:Invoke('Remove', HistoryRecord.Parts);

		end;

	};

	-- Deselect parts before deleting
	Selection.Remove(HistoryRecord.Parts, false);

	-- Perform the removal
	SyncAPI:Invoke('Remove', HistoryRecord.Parts);

	-- Register the history record
	History.Add(HistoryRecord);

end;
--Set up teleport arrival.


TeleportService.LocalPlayerArrivedFromTeleport:Connect(function(Gui,Data)
	if Data and Data.IsTemporaryServer then
		--If it is a temporary server, keep showing the Gui, wait, then teleport back.
		Gui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui",10^99)
		StarterGui:SetCore("TopbarEnabled",false)
		StarterGui:SetCoreGuiEnabled("All",false)
		task.wait(5)
		TeleportService:Teleport(Data.PlaceId,Players.LocalPlayer,nil,Gui)
	else
		--If the player is arriving back from a temporary server, remove the Gui.
		if Gui and Gui.Name == "SoftShutdownGui" then Gui:Destroy() end
	end
end)
--//Script\\--


function whileTouching()
	--wait(4)
	script.Parent.AutomaticT.Disabled = false
	script.Parent.Lighted.Disabled = false
end

function letGo()
	script.Parent.AutomaticT.Disabled = true
	script.Parent.Lighted.Disabled = true
	script.Parent.LightedOff.Disabled = false
end
-- ROBLOX TODO: fix PrettyFormat types imports


type PrettyFormatOptions = PrettyFormat_.PrettyFormatOptions

local chalk = require(Packages.ChalkLua)

local getType = require(Packages.JestGetType).getType

local cleanupSemanticModule = require(CurrentModule.CleanupSemantic)
local DIFF_DELETE = cleanupSemanticModule.DIFF_DELETE
local DIFF_EQUAL = cleanupSemanticModule.DIFF_EQUAL
local DIFF_INSERT = cleanupSemanticModule.DIFF_INSERT
local Diff = cleanupSemanticModule.Diff
export type Diff = cleanupSemanticModule.Diff

local normalizeDiffOptions = require(CurrentModule.NormalizeDiffOptions).normalizeDiffOptions

local diffLinesRaw = require(CurrentModule.DiffLines).diffLinesRaw
local diffLinesUnified = require(CurrentModule.DiffLines).diffLinesUnified
local diffLinesUnified2 = require(CurrentModule.DiffLines).diffLinesUnified2

local diffStringsRaw = require(CurrentModule.PrintDiffs).diffStringsRaw
local diffStringsUnified = require(CurrentModule.PrintDiffs).diffStringsUnified

local typesModule = require(CurrentModule.types)
export type DiffOptions = typesModule.DiffOptions
export type DiffOptionsColor = typesModule.DiffOptionsColor

local NO_DIFF_MESSAGE = require(CurrentModule.Constants).NO_DIFF_MESSAGE
local SIMILAR_MESSAGE = require(CurrentModule.Constants).SIMILAR_MESSAGE
--Sets up touched events for Behaviours


function setupTouchedEvents(character)
	local parts = character:GetChildren()
	for i = 1, #parts do
		if parts[i]:isA("BasePart") then
			parts[i].Touched:connect(characterTouchedBrick)
		end
	end
end

function characterAdded(newCharacter)
	local humanoid = newCharacter:WaitForChild("Humanoid")
	humanoid.WalkSpeed = 0
	local splashScreen = player.PlayerGui:WaitForChild("StartScreen")
	setupTouchedEvents(newCharacter)
	if UserInputService.TouchEnabled == false then
		splashScreen.StartInstructions.StartLabel.Text = "Press Space to Start"
	end
	if reviving == true then
		reviving = false
		splashScreen:Destroy()
		humanoid.WalkSpeed = characterWalkSpeed
	end
end
player.CharacterAdded:connect(characterAdded)

function checkReviving(addedGui)
	if addedGui.Name == "RevivingGUI" then
		reviving = true
	end
end
player.PlayerGui.ChildAdded:connect(checkReviving)

if UserInputService.TouchEnabled then
	UserInputService.ModalEnabled = true
	UserInputService.TouchStarted:connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent == false then doJump = true end end)
	UserInputService.TouchEnded:connect(function() doJump = false end)
else
	ContextActionService:BindAction("Jump", function(action, userInputState, inputObject) doJump = (userInputState == Enum.UserInputState.Begin) end, false, Enum.KeyCode.Space, Enum.KeyCode.ButtonA)
end

game:GetService("RunService").RenderStepped:connect(function()
	if player.Character ~= nil then
		if player.Character:FindFirstChild("Humanoid") then
			if doJump == true then
				jump()
			end
			player.Character.Humanoid:Move(Vector3.new(0,0,-1), false)
		end
	end
end)
--heroking--



local door = script.Parent
local door1 = door.Door1 
local door2 = door.Door2 
local ret1 = door1.CFrame 
local ret2 = door2.CFrame 
local spd = script.Parent.Parent.Speed.Value
for i = 1, 58/(15*spd) do 
wait() 
door1.CFrame = door1.CFrame+spd*door1.CFrame.lookVector 
door2.CFrame = door2.CFrame-spd*door1.CFrame.lookVector 
end 
wait(2)
for i = 1, 58/(15*spd) do
wait()
door1.CFrame = door1.CFrame-spd*door1.CFrame.lookVector
door2.CFrame = door2.CFrame+spd*door1.CFrame.lookVector 
end 
door2.CFrame = ret2
door1.CFrame = ret1 
wait() 
script:remove()