Roblox/luau_corpus huggingface dataset:
--Put Brakes,Headlight,Highlight,Left,Reverse,and Right into Body. 
--Put this script into Plugins
-- Duplicate your lights, make it neon and put it inside G1 of the corrisponding model.
-- What it does is it enables a light inside the parts named Light and makes the part's transparency 0. 
-- When its off, it disables the Light and sets the transparency to 1
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])

local body = car.Body

local event=car.SmeersLightsHandler

local dtapdleft=false

local uis=game:GetService("UserInputService")

uis.InputBegan:connect(function(input, gp)
	if not gp then
		if input.KeyCode==Enum.KeyCode.Z or input.KeyCode==Enum.KeyCode.DPadLeft then
			event:FireServer({["ToggleLeftBlink"]=true})
		elseif input.KeyCode==Enum.KeyCode.C or input.KeyCode==Enum.KeyCode.DPadRight then
			event:FireServer({["ToggleRightBlink"]=true})
		elseif input.KeyCode==Enum.KeyCode.V then
			event:FireServer({["ToggleStandlicht"]=true})
		elseif input.KeyCode==Enum.KeyCode.X then
			event:FireServer({["ToggleHazards"]=true})
		end
	end
end)

local Time, Activate, Blink, End = .2, 40, .1, 3
local CurrTime = 0 -- don't change this

car.DriveSeat.Changed:Connect(function(Change)
	if Change == "Throttle" then
		if car.DriveSeat.Throttle == -1 then
			event:FireServer({["EnableBrakes"]=true})
			if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate then
				repeat if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate then 
					if car.DriveSeat.Throttle == -1 then
					   CurrTime = CurrTime + .05
					else
				     CurrTime = 0
				      break 						
					end
			else
				CurrTime = 0
				break 
				 end
				wait(.05)
				 until CurrTime >= Time 
				 if CurrTime >= Time then
					CurrTime = 0
					if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate then
					repeat	
				 if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate or car.DriveSeat.Throttle == -1 then					
					event:FireServer({["EnableBrakes"]=true})
					wait(Blink)
					event:FireServer({["DisableBrakes"]=true})
					wait(Blink)	
					end
					until math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) <= End or car.DriveSeat.Throttle ~= -1
					if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) <= End then
                       event:FireServer({["ToggleHazards"]=true})
					   event:FireServer({["EnableBrakes"]=true})						
					end
					end
				else
					CurrTime = 0
				end
			end
		else
			event:FireServer({["DisableBrakes"]=true})
		end
	end
end)

script.Parent.Values.Gear.Changed:connect(function()
	if script.Parent.Values.Gear.Value == -1 then
		event:FireServer({["ReverseOn"]=true})
	elseif script.Parent.Values.Gear.Value ~= -1 then
		event:FireServer({["ReverseOff"]=true})
	end
end)
--{{TWEEN VALUES}} : EASING STYLES.
Settings.FadeOutInfo = {EasingStyle = Enum.EasingStyle.Quint, EasingDirection = Enum.EasingDirection.Out}
Settings.FadeInInfo = {EasingStyle = Enum.EasingStyle.Quad, EasingDirection = Enum.EasingDirection.In}
-- Right Legs
character.Constraint.ConstraintRightUpperLeg.Attachment0 = RUL
character.Constraint.ConstraintRightUpperLeg.Attachment1 = RULRig
character.Constraint.ConstraintRightLowerLeg.Attachment0 = RLL
character.Constraint.ConstraintRightLowerLeg.Attachment1 = RLLRig
character.Constraint.ConstraintRightFoot.Attachment0 = RF
character.Constraint.ConstraintRightFoot.Attachment1 = RFRig
------------------------------------------------------------------------------------------------------------------------------------------------
		if script.Parent:FindFirstChild("Leg1") then
			local g = script.Parent.Leg1:Clone()
			g.Parent = File
			for _,i in pairs(g:GetChildren()) do
				if i:IsA("Part") or i:IsA("UnionOperation") or i:IsA("MeshPart") then
					i.CanCollide = false
					i.Anchored = false
					local Y = Instance.new("Weld")
					Y.Part0 = Player.Character["Left Leg"]
					Y.Part1 = g.Middle
					Y.C0 = CFrame.new(0, 0, 0)
					Y.Parent = Player.Character["Left Leg"]
				end
			end
		end
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 5 -- cooldown for use of the tool again

ZoneModelName = "Disco ball" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--FakeHumanoidRootPart.Massless = true
FakeHumanoidRootPart.Transparency = 1
FakeHumanoidRootPart.Parent = Viewmodel
local FakeTorso = Instance.new("Part")
FakeTorso.Name = "Torso"
FakeTorso.CanCollide = false
FakeTorso.CanTouch = false
FakeTorso.Transparency = 1
-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about
-- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees
local MIN_Y = math.rad(-80)
local MAX_Y = math.rad(80)

local TOUCH_ADJUST_AREA_UP = math.rad(30)
local TOUCH_ADJUST_AREA_DOWN = math.rad(-15)

local TOUCH_SENSITIVTY_ADJUST_MAX_Y = 2.1
local TOUCH_SENSITIVTY_ADJUST_MIN_Y = 0.5

local VR_ANGLE = math.rad(15)
local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0)
local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0)
local VR_LOW_INTENSITY_REPEAT = 0.1
local VR_HIGH_INTENSITY_REPEAT = 0.4

local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)

local TOUCH_SENSITIVTY = Vector2.new(0.00945 * math.pi, 0.003375 * math.pi)
local MOUSE_SENSITIVITY = Vector2.new( 0.002 * math.pi, 0.0015 * math.pi )

local SEAT_OFFSET = Vector3.new(0,5,0)
local VR_SEAT_OFFSET = Vector3.new(0,4,0)
local HEAD_OFFSET = Vector3.new(0,1.5,0)
local R15_HEAD_OFFSET = Vector3.new(0, 1.5, 0)
local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0)
local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1)

local GAMEPAD_ZOOM_STEP_1 = 0
local GAMEPAD_ZOOM_STEP_2 = 10
local GAMEPAD_ZOOM_STEP_3 = 20

local PAN_SENSITIVITY = 20
local ZOOM_SENSITIVITY_CURVATURE = 0.5

local abs = math.abs
local sign = math.sign

local FFlagUserCameraToggle do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserCameraToggle")
	end)
	FFlagUserCameraToggle = success and result
end

local FFlagUserDontAdjustSensitvityForPortrait do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserDontAdjustSensitvityForPortrait")
	end)
	FFlagUserDontAdjustSensitvityForPortrait = success and result
end

local Util = require(script.Parent:WaitForChild("CameraUtils"))
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local CameraToggleStateController = require(script.Parent:WaitForChild("CameraToggleStateController"))
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))
local CameraUI = require(script.Parent:WaitForChild("CameraUI"))
--Fully made by 
--animations are made with :lerp()
--you can convert the model to use it in script builder
local npc = script.Parent
local torso = npc.Torso
local head = npc.Head
local leftarm = npc["Left Arm"]
local rightarm = npc["Right Arm"]
local leftleg = npc["Left Leg"]
local rightleg = npc["Right Leg"]
local npchumanoid = npc.Humanoid
local aksound = npc["AK-47"].shoot
------------------------------------------------------------------------
--
-- * used in luaK:need_value(), luaK:removevalues(), luaK:patchlistaux(),
--   luaK:concat()
------------------------------------------------------------------------
function luaK:getjump(fs, pc)
  local offset = luaP:GETARG_sBx(fs.f.code[pc])
  if offset == self.NO_JUMP then  -- point to itself represents end of list
    return self.NO_JUMP  -- end of list
  else
    return (pc + 1) + offset  -- turn offset into absolute position
  end
end
-----------
function module:GetPlayerData(plr)
    if not plr then plr = game:GetService("Players").LocalPlayer end
    if plr:FindFirstChild("data") then
        return HS:JSONDecode(plr.data.Value)
    else
        return nil
    end
end
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 5 -- cooldown for use of the tool again

ZoneModelName = "Dream bow" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--CHANGE THIS LINE-- (Main)(Opposite direction of turn value)
Signal = script.Parent.Parent.Parent.ControlBox.SignalValues.Signal1 -- Change last word
--- Routinely check player cache for garbage
coroutine.wrap(function()
	while wait(180) do
		ClearGarbage()
	end
end)
-- Get the HumanoidRootPart and wait for the server audio
local root = character.HumanoidRootPart
local serverSound = root:WaitForChild("CurrentSound")
-- Player Stats
local stats = player:WaitForChild("stats")
local points = stats:WaitForChild(GameSettings.pointsName)
local totalPoints = stats:WaitForChild("Total" .. GameSettings.pointsName)
local upgrades = stats:WaitForChild(GameSettings.upgradeName)
--Left lean
R6LeftLegLeftLean = .55
R6RightLegLeftLean = .3
R6LeftArmLeftLean = .3
R6RightArmLeftLean = .7
R6TorsoLeftLean = .3
--------------------------------------------------
script.Parent.Values.RPM.Changed:connect(function()
	intach.Rotation = -50 + script.Parent.Values.RPM.Value * 246 / 7500
end)

script.Parent.Values.Velocity.Changed:connect(function(property)
	inspd.Rotation = -18 + (440 / 154) * (math.abs(script.Parent.Values.Velocity.Value.Magnitude*((6/12) * (50/88))))
end)

if _Tune.Aspiration ~= "Natural" then 
	if _Tune.Aspiration == "Single" then 
		_TCount = 1 
	elseif _Tune.Aspiration == "Double" then 
		_TCount = 2 
	end
	
end
--[[Steering]]
	Tune.SteerInner		= 44		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 37		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .05		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 100000	-- Steering Aggressiveness
--// K key, Directional
mouse.KeyDown:connect(function(key)
	if key=="k" then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.Remotes.DirectionalEvent:FireServer(true)
	end
end)
--[[START]]

	script.Parent:WaitForChild("Car")
	script.Parent:WaitForChild("IsOn")
	script.Parent:WaitForChild("ControlsOpen")
	script.Parent:WaitForChild("Values")
	script.Parent:WaitForChild("DriveMode")
--good flashing
script.Parent.Color = randval1 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval3 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval1 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval3 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval1 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval3 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval2 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval4 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval2 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval4 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval2 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval4 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval5 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval6 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval5 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval6 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval5 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
script.Parent.Color = randval6 --Color3.new(math.random(), math.random(), math.random()) 
wait(0.5)
mode1()
end

function mode2()
--[[**
	ensures Roblox Region3int16 type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]
t.Region3int16 = t.typeof("Region3int16")
--////////////////////////////// Include
--//////////////////////////////////////
local ChatConstants = require(ReplicatedModules:WaitForChild("ChatConstants"))

local ChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local Speaker = require(modulesFolder:WaitForChild("Speaker"))
local Util = require(modulesFolder:WaitForChild("Util"))

local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
ChatLocalization = ChatLocalization or {}

if not ChatLocalization.FormatMessageToSend or not ChatLocalization.LocalizeFormattedMessage then
	function ChatLocalization:FormatMessageToSend(key,default) return default end
end
-- humanoidAnimatePlayEmote.lua

local Figure = script.Parent
local Torso = Figure:WaitForChild("Torso")
local RightShoulder = Torso:WaitForChild("Right Shoulder")
local LeftShoulder = Torso:WaitForChild("Left Shoulder")
local RightHip = Torso:WaitForChild("Right Hip")
local LeftHip = Torso:WaitForChild("Left Hip")
local Neck = Torso:WaitForChild("Neck")
local Humanoid = Figure:WaitForChild("Humanoid")
local pose = "Standing"

local EMOTE_TRANSITION_TIME = 0.1

local userAnimateScaleRunSuccess, userAnimateScaleRunValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserAnimateScaleRun") end)
local userAnimateScaleRun = userAnimateScaleRunSuccess and userAnimateScaleRunValue

local function getRigScale()
	if userAnimateScaleRun then
		return Figure:GetScale()
	else
		return 1
	end
end

local currentAnim = ""
local currentAnimInstance = nil
local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0
local animTable = {}
local animNames = { 
	idle = 	{	
				{ id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
				{ id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
			},
	walk = 	{ 	
				{ id = "http://www.roblox.com/asset/?id=180426354", weight = 10 } 
			}, 
	run = 	{
				{ id = "run.xml", weight = 10 } 
			}, 
	jump = 	{
				{ id = "http://www.roblox.com/asset/?id=125750702", weight = 10 } 
			}, 
	fall = 	{
				{ id = "http://www.roblox.com/asset/?id=180436148", weight = 10 } 
			}, 
	climb = {
				{ id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } 
			}, 
	sit = 	{
				{ id = "http://www.roblox.com/asset/?id=178130996", weight = 10 } 
			},	
	toolnone = {
				{ id = "", weight = 10 } 
			},
	toolslash = {
				{ id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
--[=[
	Initializes a new promise with the given function in a deferred wrapper.

	@param func (resolve: (...) -> (), reject: (...) -> ()) -> ()?
	@return Promise<T>
]=]
function Promise.defer(func)
	local self = Promise.new()

	-- Just the function part of the resolve/reject protocol!
	task.defer(func, self:_getResolveReject())

	return self
end
--[=[
	Gives a task to the maid for cleanup, but uses an incremented number as a key.

	@param task MaidTask -- An item to clean
	@return number -- taskId
]=]
function Maid:GiveTask(task)
	if not task then
		error("Task cannot be false or nil", 2)
	end

	local taskId = #self._tasks+1
	self[taskId] = task

	if type(task) == "table" and (not task.Destroy) then
		warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
	end

	return taskId
end
-----------------
--| Functions |--
-----------------

local function MakeReloadRocket()
	local reloadRocket = Instance.new('Part')
	reloadRocket.Name = "Ammo"
	reloadRocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
	reloadRocket.Size = Vector3.new() -- As small as possible

	local mesh = Instance.new('SpecialMesh', reloadRocket)
	mesh.MeshId = ROCKET_MESH_ID
	mesh.Scale = ROCKET_MESH_SCALE
	mesh.TextureId = ToolHandle.Mesh.TextureId

	return reloadRocket
end

local function OnEquipped()
	MyModel = Tool.Parent
	ReloadRocket = MakeReloadRocket()
end

local function OnChanged(property)
	if property == 'Enabled' and Tool.Enabled == false then
		-- Show the next rocket going into the launcher
		StillEquipped = true
		wait(ROCKET_SHOW_TIME)
		if StillEquipped then
			local leftArm = MyModel:FindFirstChild('Left Arm')
			if leftArm then
				local weld = ReloadRocket:FindFirstChild('Weld')
				if not weld then
					weld = Instance.new('Weld')
					weld.Part0 = leftArm
					weld.Part1 = ReloadRocket
					weld.C1 = CFrame.new(Vector3.new(0, 1, 0))
					weld.Parent = ReloadRocket
				end
				ReloadRocket.Parent = MyModel
			end
			wait(ROCKET_HIDE_TIME - ROCKET_SHOW_TIME)
			if StillEquipped and ReloadRocket.Parent == MyModel then
				ReloadRocket.Parent = nil
			end
		end
	end
end

local function OnUnequipped()
	StillEquipped = false
	ReloadRocket:Destroy()
	ReloadRocket = nil
end
-- This is a list of team names that players will not be able to switch to.

local blockedteams = {
	"Staff",
	"Admins",
	"Developers",
}

return blockedteams
-- xSIXx, Create an animatable joint when tool is equipped.








local motorName = "Handle" -- Change this to the target Motor6D name you want in the Right Arm/RightHand.






local motor = nil
--[=[
	Begins a Promise chain, calling a function and returning a Promise resolving with its return value. If the function errors, the returned Promise will be rejected with the error. You can safely yield within the Promise.try callback.

	:::info
	`Promise.try` is similar to [Promise.promisify](#promisify), except the callback is invoked immediately instead of returning a new function.
	:::

	```lua
	Promise.try(function()
		return math.random(1, 2) == 1 and "ok" or error("Oh an error!")
	end)
		:andThen(function(text)
			print(text)
		end)
		:catch(function(err)
			warn("Something went wrong")
		end)
	```

	@param callback (...: T...) -> ...any
	@param ... T... -- Additional arguments passed to `callback`
	@return Promise
]=]
function Promise.try(callback, ...)
	return Promise._try(debug.traceback(nil, 2), callback, ...)
end
----------------------------------------------------------------------------

script.Parent.Humanoid.HealthChanged:Connect(function()
	if script.Parent.Humanoid.Health <= 73 then
		
		Instance.new("Decal", script.Parent["Left Arm"])
		script.Parent["Left Arm"].Decal.Texture = "rbxassetid://408754747"
		script.Parent["Left Arm"].Decal.Face = "Bottom"
	end
end)
--------SIDE SQUARES--------

game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
--- Octree implementation
-- @module OctreeRegionUtils

local EPSILON = 1e-6
local SQRT_3_OVER_2 = math.sqrt(3) / 2
local SUB_REGION_POSITION_OFFSET = {
	{0.25, 0.25, -0.25};
	{-0.25, 0.25, -0.25};
	{0.25, 0.25, 0.25};
	{-0.25, 0.25, 0.25};
	{0.25, -0.25, -0.25};
	{-0.25, -0.25, -0.25};
	{0.25, -0.25, 0.25};
	{-0.25, -0.25, 0.25};
}

local OctreeRegionUtils = {}
-- ================================================================================
-- PUBLIC FUNCTIONS
-- ================================================================================
function GuiController:UpdateSpeed()

end -- GuiController:UpdateSpeed()

function GuiController:Start(s)
	speeder = s
	primary = speeder.PrimaryPart
	engine = speeder.engine
	
	-- Boost bar and button
	BoostSetup(function(boost)
		self.Boost = boost
	end)
	
	-- Control thumbstick:
	ThumbstickSetup(gui:WaitForChild("ThumbstickLeft"), function(x, y)
		self.Yaw = x * MOBILE_DAMP
		self.Pitch = y * MOBILE_DAMP
	end)
end -- GuiController:Start()

function GuiController:Stop()
	
end -- GuiController:Stop
--- Iterate through all modules
for _, m in ipairs(script:GetChildren()) do
	if m.ClassName == "ModuleScript" then
		--- Add it!
		Functions[m.Name] = require(m)
	end
end
---Controller
local Controller=false
local UserInputService = game:GetService("UserInputService")
local LStickX = 0
local RStickX = 0
local RStickY = 0
local RTriggerValue = 0
local LTriggerValue = 0

local ButtonX = 0
local ButtonY = 0
local ButtonL1 = 0
local ButtonR1 = 0
local ButtonR3 = 0
local DPadUp = 0
function DealWithInput(input,IsRobloxFunction)
	if Controller then
		if input.KeyCode ==Enum.KeyCode.ButtonX then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonX=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonX=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonY then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonY=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonY=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonL1 then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonL1=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonL1=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonR1 then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonR1=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonR1=0
			end
		elseif input.KeyCode ==Enum.KeyCode.DPadUp then
			if input.UserInputState == Enum.UserInputState.Begin then
				DPadUp=1
			elseif input.UserInputState == Enum.UserInputState.End then
				DPadUp=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonR3 then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonR3=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonR3=0
			end
		end
		if input.UserInputType.Name:find("Gamepad") then --it's one of 4 gamepads
			if input.KeyCode == Enum.KeyCode.Thumbstick1 then
				LStickX = input.Position.X
			elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then
				RStickX = input.Position.X
				RStickY = input.Position.Y
			elseif input.KeyCode == Enum.KeyCode.ButtonR2 then--right shoulder
				RTriggerValue = input.Position.Z
			elseif input.KeyCode == Enum.KeyCode.ButtonL2 then--left shoulder
				LTriggerValue = input.Position.Z
			end
		end
	end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)--keyboards don't activate with Changed, only Begin and Ended. idk if digital controller buttons do too
UserInputService.InputEnded:connect(DealWithInput)