Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --



This.Parent.Parent.Parent.Parent:WaitForChild("Velocity").Changed:connect(function(val)
    if This.Parent.Parent.Parent.Parent:WaitForChild("Direction").Value == 1 and val > 0 then
        This.SurfaceGui.Direction.Text = "▲"
    elseif This.Parent.Parent.Parent.Parent:WaitForChild("Direction").Value == -1 and val < 0 then
		This.SurfaceGui.Direction.Text = "▼"
	elseif This.Parent.Parent.Parent.Parent:WaitForChild("Direction").Value == 1 and val == 0 then
        This.SurfaceGui.Direction.Text = ""
    elseif This.Parent.Parent.Parent.Parent:WaitForChild("Direction").Value == -1 and val == 0 then
		This.SurfaceGui.Direction.Text = ""
	else
		This.SurfaceGui.Direction.Text = ""
    end
end)
--[[

	MatchTable {
		Some: (value: any) -> any
		None: () -> any
	}

	CONSTRUCTORS:

		Option.Some(anyNonNilValue): Option<any>
		Option.Wrap(anyValue): Option<any>


	STATIC FIELDS:

		Option.None: Option<None>


	STATIC METHODS:

		Option.Is(obj): boolean


	METHODS:

		opt:Match(): (matches: MatchTable) -> any
		opt:IsSome(): boolean
		opt:IsNone(): boolean
		opt:Unwrap(): any
		opt:Expect(errMsg: string): any
		opt:ExpectNone(errMsg: string): void
		opt:UnwrapOr(default: any): any
		opt:UnwrapOrElse(default: () -> any): any
		opt:And(opt2: Option<any>): Option<any>
		opt:AndThen(predicate: (unwrapped: any) -> Option<any>): Option<any>
		opt:Or(opt2: Option<any>): Option<any>
		opt:OrElse(orElseFunc: () -> Option<any>): Option<any>
		opt:XOr(opt2: Option<any>): Option<any>
		opt:Contains(value: any): boolean

	--------------------------------------------------------------------

	Options are useful for handling nil-value cases. Any time that an
	operation might return nil, it is useful to instead return an
	Option, which will indicate that the value might be nil, and should
	be explicitly checked before using the value. This will help
	prevent common bugs caused by nil values that can fail silently.


	Example:

	local result1 = Option.Some(32)
	local result2 = Option.Some(nil)
	local result3 = Option.Some("Hi")
	local result4 = Option.Some(nil)
	local result5 = Option.None

	-- Use 'Match' to match if the value is Some or None:
	result1:Match {
		Some = function(value) print(value) end;
		None = function() print("No value") end;
	}

	-- Raw check:
	if result2:IsSome() then
		local value = result2:Unwrap() -- Explicitly call Unwrap
		print("Value of result2:", value)
	end

	if result3:IsNone() then
		print("No result for result3")
	end

	-- Bad, will throw error bc result4 is none:
	local value = result4:Unwrap()

--]]



local CLASSNAME: string = "Option"
--local PathLib = require(gamelocal HumanoidList = require(game.ServerStorage.ROBLOX_HumanoidList).ServerStorage.PathfindingLibrary).new()


local AIUtilities = require(game.ServerStorage.ROBLOX_AIUtilities)

local ZombieAI = {}

function updateDisplay(display, state)
	local thread = coroutine.create(function()
		while true do
			wait()
			if state then
				display.Text = state.Name
			end
		end
	end)
	coroutine.resume(thread)
end

ZombieAI.new = function(model)	
	local zombie = {}	
	
	-- CONFIGURATION VARIABLES
-- Public Methods



function MaidClass:Mark(item)
	local tof = typeof(item)
	
	if (DESTRUCTORS[tof]) then
		self.Trash[item] = tof
	else
		error(FORMAT_STR:format(tof), 2)
	end
end

function MaidClass:Unmark(item)
	if (item) then
		self.Trash[item] = nil
	else
		self.Trash = {}
	end
end

function MaidClass:Sweep()
	for item, tof in next, self.Trash do
		DESTRUCTORS[tof](item)
	end
	self.Trash = {}
end
-- Compiled with roblox-ts v1.3.3
--[[
	*
	*
	* @param obj object of concern.
	* @param typeId new type. Restricted to keys of the variant.
	* @param typeKey discriminant key.
]]


local function narrow(obj, typeId, typeKey)
	local _exp = obj
	local _condition = typeKey
	if _condition == nil then
		_condition = "type"
	end
	local typeString = _exp[_condition]
	return if typeString == typeId then obj else nil
end
return {
	narrow = narrow,
}
--mute button stuff


local canmute = settings.DisplayMuteButton
local clonegui
if canmute then
	clonegui = script.MuteButtonGui:clone()
end
script.MuteButtonGui:Destroy()

local musicon = true

function SetButtonStyle(button)
	button.Text = "Music: ".. (musicon and "ON" or "OFF")
	button.Style = musicon and Enum.ButtonStyle.RobloxRoundDefaultButton or Enum.ButtonStyle.RobloxRoundDropdownButton
	button.TextColor3 = musicon and Color3.new(1,1,1) or Color3.new(.2,.2,.23)
end

function CreateButton()
	local gui = clonegui:clone()
	local button = gui.Button
	button.Visible = true
	SetButtonStyle(button)
	button.MouseButton1Click:connect(function()
		musicon = not musicon
		local bgm = script:FindFirstChild("BGM")
		if bgm then
			bgm.Volume = musicon and bgm.OriginalVolume.Value or 0
		end
		SetButtonStyle(button)
	end)
	gui.Parent = plr:WaitForChild("PlayerGui")
end

function CharInit()
	char = plr.Character
	torso = char:WaitForChild("Torso")
	if canmute then CreateButton() end
end

if plr.Character and plr.Character.Parent ~= nil then
	CharInit()
end
plr.CharacterAdded:connect(function()
	CharInit()
end)
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 2.36			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		1.94		,
		--[[ 3 ]]		1.28		,
		--[[ 4 ]]		.93		,
		--[[ 5 ]]		0.71		,
		--[[ 6 ]]		0.54		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--UserInputService.MouseIconEnabled = false



function lerp(a, b, c)
	return a + (b - a) * c
end

bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
	deltaTime = deltaTime * 30 -- Change Value, Higher Value = Bigger Movement
	if Humanoid.Health <= 0 then
		bobbing:Disconnect()
		return
	end
	local rootMagnitude = Humanoid.RootPart and Vector3.new(Humanoid.RootPart.Velocity.X, 0, Humanoid.RootPart.Velocity.Z).Magnitude or 0
	local calcRootMagnitude = math.min(rootMagnitude, 50)
	if deltaTime > 3 then
		func1 = 0
		func2 = 0
	else
		func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 20) / 200) * deltaTime, 0.05 * deltaTime)
		func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 10) / 200) * deltaTime, 0.05 * deltaTime)
	end
	Camera.CFrame = Camera.CFrame * (CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3)) * CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2) * CFrame.Angles(0, 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 5))) * CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 10)))
	val2 = math.clamp(lerp(val2, -Camera.CFrame:VectorToObjectSpace((Humanoid.RootPart and Humanoid.RootPart.Velocity or Vector3.new()) / math.max(Humanoid.WalkSpeed, 0.01)).X * 0.08, 0.1 * deltaTime), -0.35, 0.2)
	func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -5, 5), 0.25 * deltaTime)
	func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime)
	if rootMagnitude > 1 then
		val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime)
	else
		val = lerp(val, 0, 0.05 * deltaTime)
	end
	if rootMagnitude > 12 then
		int = 15 -- 20
		int2 = 11 -- 18
	elseif rootMagnitude > 0.1 then
		int = 4 -- 12 is Default. Higher = Faster Movement
		int2 = 14 --14 default, experiment with this value
	else
		int2 = 0
	end
	Player.CameraMaxZoomDistance = 25
	Player.CameraMinZoomDistance = 0.5
	vect3 = lerp(vect3, Camera.CFrame.LookVector, 0.125 * deltaTime)
end)
-- Calculate the average linear velocity of the car based on the rate at which all wheels are spinning


local function getAverageVelocity()
	local vFR = -motorFR.Attachment1.WorldAxis:Dot(motorFR.Attachment1.Parent.RotVelocity)
	local vRR = -motorBR.Attachment1.WorldAxis:Dot(motorBR.Attachment1.Parent.RotVelocity)
	local vFL = motorFL.Attachment1.WorldAxis:Dot(motorFL.Attachment1.Parent.RotVelocity)
	local vRL = motorBL.Attachment1.WorldAxis:Dot(motorBL.Attachment1.Parent.RotVelocity)
	return 0.25 * ( vFR + vFL + vRR + vRL )
end
--// Aim|Zoom|Sensitivity Customization


	ZoomSpeed = 0.25; -- The lower the number the slower and smoother the tween
	AimZoom = 50; -- Default zoom
	AimSpeed = 0.45;
	UnaimSpeed = 0.35;
	CycleAimZoom = 35; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
--		print("Keyframe : ".. frameName)



		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
-- ROBLOX NOTE:  no upstream: replaces node js writeable stream API



export type Writeable = {
	isTTY: boolean?,
	write: (self: Writeable, data: string) -> (),
}

local Writeable = {}
Writeable.__index = Writeable

function Writeable.new(options: { write: (data: string) -> () }): Writeable
	local self = setmetatable({}, Writeable)
	self._writeFn = if options ~= nil and typeof(options.write) == "function" then options.write else print
	self.isTTY = false
	return (self :: any) :: Writeable
end

function Writeable:write(data: string)
	self._writeFn(data)
end

return {
	Writeable = Writeable,
}
--[[
	[How fast the body rotates.]
	[Setting to 0 negates tracking, and setting to 1 is instant rotation. 0.5 is a nice in-between that works with MseGuide on or off.]
	[Setting this any higher than 1 causes weird glitchy shaking occasionally.]
--]]


local UpdateSpeed = 1

local NeckOrgnC0 = Neck.C0	--[Get the base C0 to manipulate off of.]
local WaistOrgnC0 = (not IsR6 and Waist.C0)	--[Get the base C0 to manipulate off of.]
--[[Weld functions]]



	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()
	
	function MakeWeld(x,y,type,s) 
		if type==nil then type="Weld" end
		local W=Instance.new(type) 
		W.Part0=x W.Part1=y 
		W.C0=x.CFrame:inverse()*x.CFrame 
		W.C1=y.CFrame:inverse()*x.CFrame 
		if type=="Motor" and s~=nil then 
			W.MaxVelocity=s 
		end 
		W.Parent = JS
		return W	
	end
	
	function ModelWeld(a,b) 
		if a:IsA("BasePart") then 
			MakeWeld(b,a,"Weld") 
		elseif a:IsA("Model") then 
			for i,v in pairs(a:GetChildren()) do 
				ModelWeld(v,b) 
			end 
		end 
	end
	
	function UnAnchor(a) 
		if a:IsA("BasePart") then a.Anchored=false  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end 
	end
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"									--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 5.2		-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.15		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.40		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.17		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		0.95		,
		--[[ 5 ]]		0.80		,
		--[[ 6 ]]       0.67
	}
	Tune.FDMult			= 1			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[=[
	Converts this arbitrary value into an observable suitable for use in properties.

	@param value any
	@return Observable?
]=]


function Blend.toPropertyObservable(value)
	if Observable.isObservable(value) then
		return value
	elseif typeof(value) == "Instance" then
		-- IntValue, ObjectValue, et cetera
		if ValueBaseUtils.isValueBase(value) then
			return RxValueBaseUtils.observeValue(value)
		end
	elseif type(value) == "table" then
		if ValueObject.isValueObject(value) then
			return ValueObjectUtils.observeValue(value)
		elseif Promise.isPromise(value) then
			return Rx.fromPromise(value)
		end
	end

	return nil
end
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
	return (not ClassInformationTable:GetClassFolder(player,"Paladin").Obtained.Value) or (not ClassInformationTable:GetClassFolder(player,"Paladin").JumpStrike1.Value)
end
--[[
	Constructs special keys for property tables which connect event listeners to
	an instance.
]]



local parseError = require(script.Parent.Parent.Dependencies).utility.parseError

local function getProperty_unsafe(instance: Instance, property: string)
	return (instance :: any)[property]
end

local function OnEvent(eventName: string)
	local eventKey = {}
	eventKey.type = "SpecialKey"
	eventKey.kind = "OnEvent"
	eventKey.stage = "observer"

	function eventKey:apply(callback: any, applyTo: Instance, cleanupTasks: {})
		local ok, event = pcall(getProperty_unsafe, applyTo, eventName)
		if not ok or typeof(event) ~= "RBXScriptSignal" then
			parseError("cannotConnectEvent", nil, applyTo.ClassName, eventName)
		elseif typeof(callback) ~= "function" then
			parseError("invalidEventHandler", nil, eventName)
		else
			table.insert(cleanupTasks, event:Connect(callback))
		end
	end

	return eventKey
end

return OnEvent
--[=[
	@param raycastParams RaycastParams
	@param distance number?
	@param overridePos Vector2?
	@return result: RaycastResult?

	Performs a raycast operation out from the mouse position (or the
	`overridePos` if provided) into world space. The ray will go
	`distance` studs forward (or 1000 studs if not provided).

	Returns the `RaycastResult` if something was hit, else returns `nil`.
]=]


function Mouse:Raycast(raycastParams, distance, overridePos)
	local viewportMouseRay = self:GetRay(overridePos)
	local result = workspace:Raycast(viewportMouseRay.Origin, viewportMouseRay.Direction * (distance or RAY_DISTANCE), raycastParams)
	return result
end
-- / Functions / --


ShootModule.ActivateModule = function(StartPosition, HitPosition, EnemyHumanoid, Damage)
	local BulletNode = Instance.new("Part")
	BulletNode.Transparency = 1
	BulletNode.CanCollide = false
	BulletNode.Anchored = true
	BulletNode.CanTouch = false
	BulletNode.CanQuery = false
	
	local StartNode = BulletNode:Clone()
	StartNode.Parent = game.Workspace
	StartNode.Position = StartPosition
	
	local EndNode = BulletNode:Clone()
	EndNode.Parent = game.Workspace
	EndNode.Position = HitPosition

	local A0 =  Instance.new("Attachment")
	A0.Parent = StartNode
	
	local A1 = Instance.new("Attachment")
	A1.Parent = EndNode

	local BulletTrail = GunAssets:WaitForChild("BulletTrail"):Clone()
	BulletTrail.Parent = Gun
	BulletTrail.Attachment0 = A0
	BulletTrail.Attachment1 = A1

	Debris:AddItem(StartNode, 0.1)
	Debris:AddItem(EndNode, 0.1)

	Debris:AddItem(A0, 0.1)
	Debris:AddItem(A1, 0.1)

	Debris:AddItem(BulletTrail, 0.1)
	
	if EnemyHumanoid then
		EnemyHumanoid:TakeDamage(Damage)
		
	end
end
-- PROPERTIES


IconController.topbarEnabled = true
IconController.controllerModeEnabled = false
IconController.previousTopbarEnabled = checkTopbarEnabled()
IconController.leftGap = 12
IconController.midGap = 12
IconController.rightGap = 12
IconController.leftOffset = 0
IconController.rightOffset = 0
IconController.mimicCoreGui = true
IconController.healthbarDisabled = false
--Horn Sound Code, Metrotren


m1=script.Parent.StartHorn
m2=script.Parent.HornSound
m3=script.Parent.EndHorn
m1:Stop() --Initial setup
m2:Stop()
m3:Stop()
m1.Volume = 0
m2.Volume = 0
m3.Volume = 0
m2.Looped = false
m2.Playing = false
script.Parent.Parent:WaitForChild("Drive").Locotrol.Event:connect(function(data)
	if data["Horn"] == true then
		m2.Volume = 0
		m2.Looped = false
		m2:Stop()
		m2.Playing = true
		m3.Volume = 0
		m3:stop()
		m1.Volume = 5
		m1:Play()
		--wait(m1.TimeLength) --disabled because it makes looping part stuck playing if stopped too soon.
		if m1.TimePosition < m1.TimeLength then
			m2.Looped = true
			m2.Volume = 5
			m2:Play()
		else
			m1.Volume = 0
			m1:Stop()
		end
	elseif data["Horn"] == false then
		m1.Volume = 0
		m1:Stop()
		--For 3 part option
		m2.Volume = 0
		m2:Stop()
		m2.Looped = false
		m2.Playing = false
		m3.Volume = 5
		m3:Play()
		
		--[[ -- For 2 part option
		if m2.IsPlaying == true then
			for i=1, 0, -.1 do
				m2.Volume = i*1
				wait(.1)
			end
		end
		m2.Volume = 0
		m2.Looped = false
		m2.Playing = false
		m2:Stop()
		--]]	
	end
end)
--[[
	Given a [AssetType], this function will match it to its equivalent
	[AccessoryType].

	```lua
	matchAssetTypeToAccessoryType(Enum.AssetType.FaceAccessory) -- Enum.AccessoryType.Face
	matchAssetTypeToAccessoryType(Enum.AssetType.Hat) -- Enum.AccessoryType.Hat
	matchAssetTypeToAccessoryType(Enum.AssetType.WaistAccessory) -- Enum.AccessoryType.Waist
	```


	This function is called when we'd like to convert a given Enum.AssetType into its corresponding Enum.AccessoryType.

	@within Modules
	@return Enum.AccessoryType The AccessoryType that matches `assetType`, otherwise returns [Enum.AccessoryType.Unknown].
]]



local function matchAssetTypeToAccessoryType(assetType: Enum.AssetType): Enum.AccessoryType
	if not assetType or not assetType.Name then
		return Enum.AccessoryType.Unknown
	end

	for _, accessoryType in ipairs(Enum.AccessoryType:GetEnumItems()) do
		if string.gsub(assetType.Name, "Accessory", "") == accessoryType.Name then
			return accessoryType
		end
	end

	return Enum.AccessoryType.Unknown
end

return matchAssetTypeToAccessoryType
--[=[
	Adds a callback to be called before save. This may return a promise.
	@param callback function -- May return a promise
	@return function -- Call to remove
]=]


function DataStoreStage:AddSavingCallback(callback)
	assert(type(callback) == "function", "Bad callback")

	table.insert(self._savingCallbacks, callback)

	return function()
		self:RemoveSavingCallback(callback)
	end
end
-- Ring1 descending


for l = 1,#lifts1 do
	if (lifts1[l].className == "Part") then
	lifts1[l].BodyPosition.position = Vector3.new((lifts1[l].BodyPosition.position.x),(lifts1[l].BodyPosition.position.y-0),(lifts1[l].BodyPosition.position.z))
	end
end
wait(0.1)
for p = 1,#parts1 do
	parts1[p].CanCollide = false
end
wait(0.1)
--!strict



local RunService = game:GetService("RunService")

local SteppedEvents = {}

local module = {}

function module:BindToStepped (name: string, func: () -> ())
	if SteppedEvents[name] then
		SteppedEvents[name]:Disconnect()
	end
	
	SteppedEvents[name] = RunService.Stepped:Connect(func)
end

function module:UnbindFromStepped (name: string)
	if SteppedEvents[name] then
		SteppedEvents[name]:Disconnect()
		SteppedEvents[name] = nil
	else
		warn("Nothing to unbind", name, "was already disconnected.")
	end
end

return module
-- this is a dummy object that holds the flash made when the gun is fired


local FlashHolder = nil


local WorldToCellFunction = workspace.Terrain.WorldToCellPreferSolid
local GetCellFunction = workspace.Terrain.GetCell

function RayIgnoreCheck(hit, pos)
	if hit then
		if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
				hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
				hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
			return true
		elseif hit:IsA('Terrain') and pos then
			local cellPos = WorldToCellFunction(workspace.Terrain, pos)
			if cellPos then
				local cellMat = GetCellFunction(workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
				if cellMat and cellMat == Enum.CellMaterial.Water then
					return true
				end
			end
		end
	end
	return false
end
--if color == "Green" then
--wait ()
--elseif color == "Yellow" then
--wait(3)
--elseif color == "Red" then
--wait(0.3)
--end


if color == "Green" then
script.Parent.Big.Value = false
script.Parent.Size = UDim2.new(0.5, 0, 0.5, 0)
script.Parent.Position = UDim2.new(0.25, 0, 0.899999976, 0)
elseif color == "Yellow" then
if script.Parent.Big.Value == false then
script.Parent.Big.Value = true
script.Parent.heartbeat:Play()
script.Parent.Size = UDim2.new(0.6, 0, 0.6, 0)
script.Parent.Position = UDim2.new(0.219999999, 0, 0.899999976, -3)
wait(1)
elseif script.Parent.Big.Value == true then
script.Parent.Big.Value = false
script.Parent.heartbeatlow:Play()
script.Parent.Size = UDim2.new(0.5, 0, 0.5, 0)
script.Parent.Position = UDim2.new(0.25, 0, 0.899999976, 0)
end
elseif color == "Red" then
if script.Parent.Big.Value == false then
script.Parent.Big.Value = true
script.Parent.heartbeat:Play()
script.Parent.Size = UDim2.new(0.6, 0, 0.6, 0)
script.Parent.Position = UDim2.new(0.219999999, 0, 0.899999976, -3)
wait(0.3)
elseif script.Parent.Big.Value == true then
script.Parent.Big.Value = false
script.Parent.heartbeatlow:Play()
script.Parent.Size = UDim2.new(0.5, 0, 0.5, 0)
script.Parent.Position = UDim2.new(0.25, 0, 0.899999976, 0)
end
elseif color == "Dead" then
script.Parent.Big.Value = false
script.Parent.Size = UDim2.new(0.5, 0, 0.5, 0)
script.Parent.Position = UDim2.new(0.25, 0, 0.899999976, 0)
wait(10)
end
end
-- declarations



local sDied = newSound("rbxasset://sounds/uuhhh.wav")
local sFallingDown = newSound("rbxasset://sounds/splat.wav")
local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
local sGettingUp = newSound("rbxasset://sounds/hit.wav")
local sJumping = newSound("rbxasset://sounds/button.wav")
local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
sRunning.Looped = true

local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Human")
--[[**
		creates an intersection type

		@param ... The checks to intersect

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


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

		return function(value)
			for _, check in ipairs(checks) do
				local success = check(value)
				if not success then
					return false
				end
			end

			return true
		end
	end
-- Public Constructors



function CheckboxLabelClass.new(frame)
	local self = setmetatable({}, CheckboxLabelClass)
	
	self._Maid = Lazy.Utilities.Maid.new()
	self._ChangedBind = Instance.new("BindableEvent")
	
	self.Frame = frame
	self.Button = frame.CheckContainer.CheckButton
	self.Changed = self._ChangedBind.Event
	
	init(self)
	self:SetValue(false)
	
	return self
end

function CheckboxLabelClass.Create(text)
	local cbLabel = CHECKBOX_LABEL:Clone()
	cbLabel.Label.Text = text
	return CheckboxLabelClass.new(cbLabel)
end