Roblox/luau_corpus huggingface dataset:
--returns the wielding player of this tool
function getPlayer()
	local char = Tool.Parent
	return game:GetService("Players"):GetPlayerFromCharacter(Character)
end

function Toss(direction)
	local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
	local spawnPos = Character.Head.Position
	
	spawnPos  = spawnPos + (direction * 5)
	
	local Object = Tool.Handle:Clone()
	Object.Burn.Attachment.Debris.Enabled = true
	Object.ThinkFast:Destroy()
	Object.Parent = workspace
	Object.Swing.Pitch = Random.new():NextInteger(90, 110)/100
	Object.Swing:Play()
	Object.CanCollide = true
	Object.CFrame = Tool.Handle.CFrame
	Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
	Object.Trail.Enabled = true
	
	local rand = 11.25
	Object.RotVelocity = Vector3.new(Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand))
	Object:SetNetworkOwner(getPlayer())
	
	local ScriptClone = DamageScript:Clone()
	ScriptClone.Parent = Object
	ScriptClone.Disabled = false
	
	local tag = Instance.new("ObjectValue")
	tag.Value = getPlayer()
	tag.Name = "creator"
	tag.Parent = Object
end


PowerRemote.OnServerEvent:Connect(function(player, Power)
	local holder = getPlayer()
	if holder ~= player then return end
	
	AttackVelocity = Power
end)

TossRemote.OnServerEvent:Connect(function(player, mousePosition)
	local holder = getPlayer()
	if holder ~= player then return end
	
	if Cooldown.Value == true then return end
	Cooldown.Value = true
	
	if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
		TossRemote:FireClient(getPlayer(), "PlayAnimation", "Animation")
	end
	local targetPos = mousePosition.p
	local lookAt = (targetPos - Character.Head.Position).unit
	
	local SecretRNG = Random.new():NextInteger(1,10) --Change RNG value here
	if SecretRNG == 1 then
		local ChucklenutsSound = Tool.Handle.ThinkFast:Play()
	end
	
	Toss(lookAt)
	Tool:Destroy()
end)

Tool.Equipped:Connect(function()
	Character = Tool.Parent
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)

Tool.Unequipped:Connect(function()
	Character = nil
	Humanoid = nil
end)
-- dark886's click regen script 
-- just place this script to the button
-- just place the button to the model
-- just place the model to anywhere lol

location = script.Parent.Parent.Parent
regen = script.Parent.Parent
save = regen:clone()

function onClicked()
	regen:remove()
	back = save:clone()
	back.Parent = location
	back:MakeJoints()
end 

script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- Format params: N/A
local ERR_OBJECT_DISPOSED = "This Caster has been disposed. It can no longer be used."
-- RENDER LOOP --
local MPL,PL,curr=0 curr=Sound.SoundId
game:GetService'RunService'.RenderStepped:connect(function()
	PL=Sound.PlaybackLoudness
	if Sound.IsPlaying and PL==PL then -- Sound is playing & PlaybackLoudness is not undefined
		if curr~=Sound.SoundId then MPL=0 -- Reset the relative Max PlaybackLoudness on song change
			curr=Sound.SoundId
		end
		MPL=math.max(PL,MPL) PL=PL/MPL -- Normalize PL based on relative Max PlaybackLoudness
		if PL==PL then
			Set(math.floor(PL*nBars),PL*Height) -- Modify bar relative to PlaybackLoudness
		end
	end
end)
while wait() do
	script.Activator.Value = not script.Activator.Value
end
--	carSeat.Parent.Body.Dash.Screen.G.Radio.Song.Text = "Custom song"
--	carSeat.Parent.Body.Dash.Screen.G.Radio.Title.Text = ""
end

F.pauseSong = function()
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
--[=[
    Parses a localization table and adds a pseudo localized locale to the table.

    @param localizationTable LocalizationTable -- LocalizationTable to add to.
    @param preferredLocaleId string? -- Preferred locale to use. Defaults to "qlp-pls"
    @param preferredFromLocale string? -- Preferred from locale. Defaults to "en-us"
    @return string -- The translated line
]=]
function PseudoLocalize.addToLocalizationTable(localizationTable, preferredLocaleId, preferredFromLocale)
	local localeId = preferredLocaleId or "qlp-pls"
	local fromLocale = preferredFromLocale or "en"

	local entries = localizationTable:GetEntries()
	for _, entry in pairs(entries) do
		if not entry.Values[localeId] then
			local line = entry.Values[fromLocale]
			if line then
				entry.Values[localeId] = PseudoLocalize.pseudoLocalize(line)
			else
				warn(("[PseudoLocalize.addToLocalizationTable] - No entry in key %q for locale %q")
					:format(entry.Key, fromLocale))
			end
		end
	end

	localizationTable:SetEntries(entries)
end
--Rescripted by Luckymaxer

Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")

Gravity = 196.20
JumpHeightPercentage = 0.25

ToolEquipped = false

function GetAllConnectedParts(Object)
	local Parts = {}
	local function GetConnectedParts(Object)
		for i, v in pairs(Object:GetConnectedParts()) do
			local Ignore = false
			for ii, vv in pairs(Parts) do
				if v == vv then
					Ignore = true
				end
			end
			if not Ignore then
				table.insert(Parts, v)
				GetConnectedParts(v)
			end
		end
	end
	GetConnectedParts(Object)
	return Parts
end

function SetGravityEffect()
	if not GravityEffect or not GravityEffect.Parent then
		GravityEffect = Instance.new("BodyForce")
		GravityEffect.Name = "GravityCoilEffect"
		GravityEffect.Parent = Torso
	end
	local TotalMass = 0
	local ConnectedParts = GetAllConnectedParts(Torso)
	for i, v in pairs(ConnectedParts) do
		if v:IsA("BasePart") then
			TotalMass = (TotalMass + v:GetMass())
		end
	end
	local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
	GravityEffect.force = Vector3.new(0, TotalMass, 0)
end

function HandleGravityEffect(Enabled)
	if not CheckIfAlive() then
		return
	end
	for i, v in pairs(Torso:GetChildren()) do
		if v:IsA("BodyForce") then
			v:Destroy()
		end
	end
	for i, v in pairs({ToolUnequipped, DescendantAdded, DescendantRemoving}) do
		if v then
			v:disconnect()
		end
	end
	if Enabled then
		CurrentlyEquipped = true
		ToolUnequipped = Tool.Unequipped:connect(function()
			CurrentlyEquipped = false
		end)
		SetGravityEffect()
		DescendantAdded = Character.DescendantAdded:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
		DescendantRemoving = Character.DescendantRemoving:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
	end
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HumanoidDied = Humanoid.Died:connect(function()
		if GravityEffect and GravityEffect.Parent then
			GravityEffect:Destroy()
		end
	end)
	HandleGravityEffect(true)
	ToolEquipped = true
end

function Unequipped()
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HandleGravityEffect(false)
	ToolEquipped = false
end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
--[=[
	@tag Component Class
	`Stop` is called when the component is stopped. This occurs either when the
	bound instance is removed from one of the whitelisted ancestors _or_ when
	the matching tag is removed from the instance. This also means that the
	instance _might_ be destroyed, and thus it is not safe to continue using
	the bound instance (e.g. `self.Instance`) any longer.

	This should be used to clean up the component.

	```lua
	local MyComponent = Component.new({Tag = "MyComponent"})

	function MyComponent:Stop()
		self.SomeStuff:Destroy()
	end
	```
]=]
function Component:Stop() end
--------LEFT DOOR --------
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(1)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(1)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(1)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(1)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(21)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(21)
--[[*
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 ]]

local CurrentModule = script.Parent
local Packages = CurrentModule.Parent
local exports = {}

local chalk = require(Packages.ChalkLua)
local clearLine = require(script.Parent.clearLine).default
local isInteractive = require(script.Parent.isInteractive).default

local RobloxShared = require(Packages.RobloxShared)
type Writeable = RobloxShared.Writeable

local function print(stream: Writeable): ()
	if isInteractive then
		stream:write(chalk.bold.dim("Determining test suites to run..."))
	end
end
exports.print = print

local function remove(stream: Writeable): ()
	if isInteractive then
		clearLine(stream)
	end
end
exports.remove = remove

return exports
--!strict
local Array = script.Parent
local LuauPolyfill = Array.Parent
local isArray = require(Array.isArray)
local instanceof = require(LuauPolyfill.instanceof)
local Set = require(LuauPolyfill.Set)
local Map = require(LuauPolyfill.Map)

local fromString = require(script.fromString)
local fromSet = require(script.fromSet)
local fromMap = require(script.fromMap)
local fromArray = require(script.fromArray)

local types = require(LuauPolyfill.types)

type Array<T> = types.Array<T>
type Object = types.Object
type Set<T> = types.Set<T>
type Map<K, V> = types.Map<K, V>
type mapFn<T, U> = (element: T, index: number) -> U
type mapFnWithThisArg<T, U> = (thisArg: any, element: T, index: number) -> U

return function<T, U>(
	value: string | Array<T> | Set<T> | Map<any, any>,
	mapFn: (mapFn<T, U> | mapFnWithThisArg<T, U>)?,
	thisArg: Object?
	-- FIXME Luau: need overloading so the return type on this is more sane and doesn't require manual casts
): Array<U> | Array<T> | Array<string>
	if value == nil then
		error("cannot create array from a nil value")
	end
	local valueType = typeof(value)

	local array: Array<U> | Array<T> | Array<string>

	if valueType == "table" and isArray(value) then
		array = fromArray(value :: Array<T>, mapFn, thisArg)
	elseif instanceof(value, Set) then
		array = fromSet(value :: Set<T>, mapFn, thisArg)
	elseif instanceof(value, Map) then
		array = fromMap(value :: Map<any, any>, mapFn, thisArg)
	elseif valueType == "string" then
		array = fromString(value :: string, mapFn, thisArg)
	else
		array = {}
	end

	return array
end
-- Initialize the tool
local ResizeTool = {
	Name = 'Resize Tool';
	Color = BrickColor.new 'Cyan';

	-- Default options
	Increment = 1;
	Directions = 'Normal';
}

ResizeTool.ManualText = [[<font face="GothamBlack" size="16">Resize Tool  🛠</font>
Allows you to resize parts.<font size="12"><br /></font>
<font size="12" color="rgb(150, 150, 150)"><b>Directions</b></font>
Lets you choose in which directions to resize the part.<font size="6"><br /></font>

<b>TIP: </b>Click on a part to focus the handles on it.<font size="6"><br /></font>

<b>TIP: </b>Hit <b>Enter</b> to switch between directions quickly.<font size="12"><br /></font>

<font size="12" color="rgb(150, 150, 150)"><b>Increment</b></font>
Lets you choose how many studs to resize by.<font size="6"><br /></font>

<b>TIP: </b>Hit the – key to quickly type increments.<font size="6"><br /></font>

<b>TIP: </b>Use your number pad to resize exactly by the current increment. Holding <b>Shift</b> reverses the increment.<font size="4"><br /></font>
   <font color="rgb(150, 150, 150)">•</font>  8 & 2 — up & down
   <font color="rgb(150, 150, 150)">•</font>  1 & 9 — back & forth
   <font color="rgb(150, 150, 150)">•</font>  4 & 6 — left & right<font size="12"><br /></font>

<font size="12" color="rgb(150, 150, 150)"><b>Snapping</b></font>
Hold the <b><i>R</i></b> key, and <b>click and drag the snap point</b> of a part (in the direction you want to resize) towards the snap point of another part, to resize up to that point.
]]
--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 plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	return plrData.Money.Gold.Value >= 70
end
--This uses a 24 hour format.
--This example uses 18:00 to 7:30, or 6 PM to 7:30 AM

local time1 = 18 --18:00, or 6:00 PM
local time2 = 7.5 --07:30, or 7:30 AM

function event1() --Event when the time is within your designated time.
	Light.Enabled = true
	LightSource.Material = "Neon"
end

function event2() --Event when the time is outside your designated time.
	Light.Enabled = false
	LightSource.Material = "SmoothPlastic"
end

function onChanged()
	if time2 <= time1 then
		if l:GetMinutesAfterMidnight() >= toMinutes(time1) or l:GetMinutesAfterMidnight() <= toMinutes(time2) then
		event1()
		else
		event2()
		end
	elseif time2 >= time1 then
		if l:GetMinutesAfterMidnight() >= toMinutes(time1) and l:GetMinutesAfterMidnight() <= toMinutes(time2) then
		event1()
		else
		event2()
		end
	end
end

l.Changed:connect(onChanged)
-- Libraries
local Support = require(Libraries:WaitForChild 'SupportLibrary')
local Roact = require(Vendor:WaitForChild 'Roact')
local Maid = require(Libraries:WaitForChild 'Maid')
--[[
	Takes a table and returns a list of keys in that table
]]
local function listOfKeys(t)
	local result = {}
	for key,_ in pairs(t) do
		table.insert(result, key)
	end
	return result
end
-- TODO: retry multiple time if HTTP call fail
local function getTextureId(id: number): number?
	local assetInfo = MarketplaceService:GetProductInfo(id, Enum.InfoType.Asset)

	if assetInfo.AssetTypeId == Enum.AssetType.Image.Value then
		return id
	elseif assetInfo.AssetTypeId == Enum.AssetType.Decal.Value then
		return HttpService:GetAsync(`http://f3xteam.com/bt/getDecalImageID/{id}`)
	end

	return
end

Remote.OnServerEvent:Connect(function(plr, id: number | string)
	if Helper.Owner ~= plr then
		return
	end

	local assetId = tonumber(tostring(id):match("%d+") or 0) :: number

	if assetId == 0 then
		Decal.Texture = ""
		return
	end

	local textureId = getTextureId(assetId)

	if not textureId then
		Decal.Texture = ""
		return
	end

	if textureId == 0 then
		Decal.Texture = ""
	else
		Decal.Texture = `rbxassetid://{textureId}`
	end
end)
--easter egg
mouse.KeyDown:connect(function(key)
	if key=="u" and script.Blown.Value == false then
		Heat = Heat+10
	end
end)
--health.Changed:connect(function()
--root.Velocity = Vector3.new(0,5000,0)
--end)

local anims = {}
local lastAttack= tick()

local target,targetType

local lastLock = tick()

local fleshDamage = 25
local structureDamage = 15

local path = nil


for _,animObject in next,animations do
anims[animObject.Name] = hum:LoadAnimation(animObject)
end

function Attack(thing,dmg)
if tick()-lastAttack > 2 then
hum:MoveTo(root.Position)
lastAttack = tick()
anims.AntWalk:Stop()
anims.AntMelee:Play()

if thing.ClassName == "Player" then
root.FleshHit:Play()
ant:SetPrimaryPartCFrame(CFrame.new(root.Position,Vector3.new(target.Character.PrimaryPart.Position.X,root.Position.Y,target.Character.PrimaryPart.Position.Z)))

elseif thing.ClassName == "Model" then
root.StructureHit:Play()
end

rep.Events.NPCAttack:Fire(thing,dmg) 
end
end


function Move(point)
hum:MoveTo(point)
if not anims.AntWalk.IsPlaying then
anims.AntWalk:Play()
end
end

function ScanForPoint()
local newPoint
local rayDir = Vector3.new(math.random(-100,100)/100,0,math.random(-100,100)/100)
local ray = Ray.new(root.Position,rayDir*math.random(10,50),ant)
local part,pos = workspace:FindPartOnRay(ray)
Move(pos)
enRoute = true
end
-- you don't have to change these if you chose auto setup
-- put these to true if you have these plugins in your car, otherwise leave them as false

smoke = true
backfire = false
horn = true
brakewhistle = true
ignition = false
audioname = "Start" -- the name of your startup audio (defaults as "Start") (only works with ignition on)
--

local Triangle = {}
Triangle.__index = Triangle

function Triangle.new(parent)
	local self = setmetatable({}, Triangle)
	
	self.a = nil
	self.b = nil
	self.c = nil
	
	self.WedgeA = WEDGE:Clone()
	self.WedgeB = WEDGE:Clone()
	self.Parent = parent
	
	return self
end
-- ALEX WAS HERE LOL

local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local u2 = Random.new();
return function(t)
	local _tick = tick()
	while (tick() - _tick) < t do
		u1.RunService.Heartbeat:Wait()
	end
end
---- Leave this the same
--game.ReplicatedStorage.TypeOutText.OnClientEvent:Connect(function(Text)
--	Typewrite(Text)
--end)
local dm = require(script.Parent.DialogueHandler)

game.ReplicatedStorage.Dialogue.OnClientEvent:Connect(function(text: string)
	dm.display(text)
end)
--Don't Delete This Script Because It's The One That Makes The Script
--Work I swear It's Not A FAKE one.



local error = "Delete"
--// Damage Settings	
	Damage = 600;
	HeadDamage = 690; -- If you set this to 100, there's a chance the player won't die because of the heal script
--//Custom Functions\\--
function TagHumanoid(humanoid, player)
	local Creator_Tag = Instance.new("ObjectValue")
	Creator_Tag.Name = "creator"
	Creator_Tag.Value = player
	debris:AddItem(Creator_Tag, 0.3)
	Creator_Tag.Parent = humanoid
end

function UntagHumanoid(humanoid)
	for i, v in pairs(humanoid:GetChildren()) do
		if v:IsA("ObjectValue") and v.Name == "creator" then
			v:Destroy()
		end
	end
end

function TextEffects(element, floatAmount, direction, style, duration)
	element:TweenPosition(UDim2.new(0, math.random(-40, 40), 0, -floatAmount), direction, style, duration)
	wait(0.5)

	for i = 1, 60 do
		element.TextTransparency = element.TextTransparency + 1/60
		element.TextStrokeTransparency = element.TextStrokeTransparency + 1/60
		wait(1/60)
	end

	element.TextTransparency = element.TextTransparency + 1
	element.TextStrokeTransparency = element.TextStrokeTransparency + 1
	element.Parent:Destroy()
end

function DynamicText(damage, criticalPoint, humanoid)
	local bill = Instance.new("BillboardGui", humanoid.Parent.Head)
	bill.Size = UDim2.new(0, 50, 0, 100) 
	local part = Instance.new("TextLabel", bill) 
	bill.AlwaysOnTop = true
	part.TextColor3 = Color3.fromRGB(255, 0, 0)
	part.Text = damage
	part.Font = Enum.Font.SourceSans
	part.TextStrokeTransparency = 0
	part.Size = UDim2.new(1, 0, 1, 0) 
	part.Position = UDim2.new(0, 0, 0, 0) 
	part.BackgroundTransparency = 1
	bill.Adornee = bill.Parent
			
	if damage < criticalPoint then
		part.TextSize = 28
		part.TextColor3 = Color3.new(1, 0, 0)
	elseif damage >= criticalPoint then
		part.TextSize = 32
		part.TextColor3 = Color3.new(1, 1, 0)
	end 
	
	spawn(function()
		TextEffects(part, 85, Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.75)
	end)
end

function DamageAndTagHumanoid(player, humanoid, damage)
	hit:FireClient(player)
	UntagHumanoid(handle)
	print("My Player =", player.Name)
	local brd = player:FindFirstChild("leaderstats")
	if brd then
		brd["Points"].Value = brd["Points"].Value + 1
	end
	humanoid:TakeDamage(damage) TagHumanoid(humanoid, player)
end
------------------------------------------------------------------------
-- works like the lobject.h version except that TObject used in these
-- scripts only has a 'value' field, no 'tt' field (native types used)
------------------------------------------------------------------------
function luaU:ttype(o)
  local tt = type(o.value)
  if tt == "number" then return self.LUA_TNUMBER
  elseif tt == "string" then return self.LUA_TSTRING
  elseif tt == "nil" then return self.LUA_TNIL
  elseif tt == "boolean" then return self.LUA_TBOOLEAN
  else
    return self.LUA_TNONE  -- the rest should not appear
  end
end
--[=[
	@within TableUtil
	@function Filter
	@param tbl table
	@param predicate (value: any, key: any, tbl: table) -> keep: boolean
	@return table

	Performs a filter operation against the given table, which can be used to
	filter out unwanted values from the table.

	For example:

	```lua
	local t = {A = 10, B = 20, C = 30}
	local t2 = TableUtil.Filter(t, function(key, value)
		return value > 15
	end)
	print(t2) --> {B = 40, C = 60}
	```
]=]
local function Filter(t: Table, f: FilterPredicate): Table
	assert(type(t) == "table", "First argument must be a table")
	assert(type(f) == "function", "Second argument must be a function")
	local newT = table.create(#t)
	if #t > 0 then
		local n = 0
		for i,v in ipairs(t) do
			if f(v, i, t) then
				n += 1
				newT[n] = v
			end
		end
	else
		for k,v in pairs(t) do
			if f(v, k, t) then
				newT[k] = v
			end
		end
	end
	return newT
end
-- Landing
local canLand = false

local landingSound = Instance.new("Sound")
landingSound.SoundId = "rbxassetid://" .. stompSoundID
landingSound.Name = "LandingSound"
landingSound.PlaybackSpeed = 0.75
landingSound.Volume = 0.85
landingSound.Parent = head

humanoid.StateChanged:Connect(function()
	local state = humanoid:GetState()
	if (state == Enum.HumanoidStateType.Jumping or state == Enum.HumanoidStateType.Freefall) and canLand == false then
		canLand = true
	elseif state == Enum.HumanoidStateType.Landed and canLand == true then
		if landingSound and landingSound.IsLoaded then
			landingSound:Play()
		end
		defaultSound.TimePosition = 0
		canLand = false
	end
end)
--[[
	
	Boolean   Keyboard:IsDown(keyCode)
	Boolean   Keyboard:AreAllDown(keyCodes...)
	Boolean   Keyboard:AreAnyDown(keyCodes...)
	
	Keyboard.KeyDown(keyCode)
	Keyboard.KeyUp(keyCode)
	
--]]



local Keyboard = {}

local userInput = game:GetService("UserInputService")


function Keyboard:IsDown(keyCode)
	return userInput:IsKeyDown(keyCode)
end


function Keyboard:AreAllDown(...)
	for _,keyCode in pairs{...} do
		if (not userInput:IsKeyDown(keyCode)) then
			return false
		end
	end
	return true
end


function Keyboard:AreAnyDown(...)
	for _,keyCode in pairs{...} do
		if (userInput:IsKeyDown(keyCode)) then
			return true
		end
	end
	return false
end


function Keyboard:Start()
	
end


function Keyboard:Init()
	
	self.KeyDown = self.Shared.Signal.new()
	self.KeyUp = self.Shared.Signal.new()
	
	userInput.InputBegan:Connect(function(input, processed)
		if (processed) then return end
		if (input.UserInputType == Enum.UserInputType.Keyboard) then
			self.KeyDown:Fire(input.KeyCode)
		end
	end)
	
	userInput.InputEnded:Connect(function(input, processed)
		if (processed) then return end
		if (input.UserInputType == Enum.UserInputType.Keyboard) then
			self.KeyUp:Fire(input.KeyCode)
		end
	end)
	
end


return Keyboard
---Display enter or flip prompt---
function module.ShowPrompt(seat, parent)
	if not AdornedSeat then
		ContextActionService:BindAction(
			SEATING_ACTION_NAME,
			seatingAction,
			false,
			Keymap.EnterVehicleGamepad,
			Keymap.EnterVehicleKeyboard
		)
		if isFlipped(seat) then
			FlipImageButton.Visible = true
			EnterImageButton.Visible = false
		else
			FlipImageButton.Visible = false
			EnterImageButton.Visible = true
		end
		AdornedSeat = seat
		ButtonGui.Adornee = seat
		ButtonGui.Enabled = true
		ButtonGui.Parent = parent
		if seat.Name == "VehicleSeat" then
			EnterImageButton.Image = DriverButtonId
			EnterImageButton.Pressed.Image = DriverButtonPressedId
		else
			EnterImageButton.Image = PassengerButtonId
			EnterImageButton.Pressed.Image = PassengerButtonPressedId
		end
	end
end

function module.HidePrompt()
	ContextActionService:UnbindAction(SEATING_ACTION_NAME)
	AdornedSeat = nil
	ButtonGui.Adornee = nil
	ButtonGui.Enabled = false
	ButtonGui.Parent = script
end

return module