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


 
mouse.KeyDown:connect(function (key)
    key = string.lower(key)
        if key == "a" then
            	a = true
        elseif key == "d" then
                d = true
        elseif key == "w" then
                w = true
                rwd.Throttle = 1
				rwd.Torque = tq
				lwd.Throttle = 1
				lwd.Torque = ftq
				rrwd.Throttle = 1
				rrwd.Torque = ftq
				rwd.MaxSpeed = 305
				lwd.MaxSpeed = 305
				rrwd.MaxSpeed = 305
                carSeat.Throttle = 1
                carSeat.Torque = 0
                elseif key == "s" then
                s = true    
                carSeat.Throttle = 0
                carSeat.Torque = 0
				rwd.Throttle = -1
				rwd.Torque = brk
				lwd.Throttle = -1
				lwd.Torque = brk
				rrwd.Throttle = -1
				rrwd.Torque = brk
				rwd.MaxSpeed = 25
				lwd.MaxSpeed = 25
				rrwd.MaxSpeed = 25
                end
end)
 
mouse.KeyUp:connect(function (key)
    key = string.lower(key)
        if key == "a" then
                print("a up")
                if d == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
                end
        elseif key == "d" then
                print("d up")
                if a == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
end
        end
        a = false
        d = false
end)
 
mouse.KeyUp:connect(function (key)
    key = string.lower(key)
if key == "w" or key == "s" then
        rwd.Throttle = 0
        rwd.Torque = 0
	    lwd.Throttle = 0
		lwd.Torque = 0
		rrwd.Throttle = 0
		rrwd.Torque = 0

       carSeat.Throttle = 0
carSeat.Torque = cst
        end
end)   
               
 
 
limitButton.MouseButton1Click:connect(function()
-- loop through all the arm parts and make them visible in first person


local function setArmVisibility(bool)
	local castshadow = not bool
	for i, part in ipairs(ArmPartsTable) do
		part.LocalTransparencyModifier = armTransparency
		part.CastShadow = castshadow
	end
end

local function toggleViewmodel(toggle)
	isFirstPerson = toggle --// Update the first person state
	Viewmodel.Parent = toggle and workspace.CurrentCamera or nil --// Put the Viewmodel in the camera, or take it out
	RightShoulderClone.Enabled = toggle --// Update joints
	LeftShoulderClone.Enabled = toggle
	LeftShoulder.Enabled = (not toggle) --// Update the original joints (to prevent :fling incidents)
	RightShoulder.Enabled = (not toggle)
	if toggle then
		RightShoulderClone.Part1 = RightArm
		RightShoulderClone.Part0 = FakeTorso
		RightShoulderClone.Parent = FakeTorso
		--// I'm not sure what the point of doing this here is. I'm too scared to change it though because this code is AWFUL.
		--// God knows what would happen.
		LeftShoulderClone.Part1 = LeftArm
		LeftShoulderClone.Part0 = FakeTorso
		LeftShoulderClone.Parent = FakeTorso
	end
end
-- only 2 locals,yeah...



local player = game.Players.LocalPlayer
local char = player.Character
char:WaitForChild("Humanoid").Died:Connect(function() --check if player got oofed
	wait()
	script.Parent.BackgroundTransparency = 0 -- make it not transparent(just to be 100% sure it will be visible after)
	player.CameraMode = 0 -- set third person
	player.CameraMaxZoomDistance = 3 -- lock the camera zoom
    player.CameraMinZoomDistance = 3
	wait(1)
	script.Parent.Deathsound:Play() -- play the sound
	wait(1)
	script.Parent.Visible = true -- make screen go black xd
	player.CameraMaxZoomDistance = 0.5 --reset the zoom
	player.CameraMinZoomDistance = 0.5
	player.CameraMode = 1 -- set first person
	wait(3) -- screen fade out UwU
	script.Parent.BackgroundTransparency = 0.1
	wait(0.3)
	script.Parent.BackgroundTransparency = 0.2
	wait(0.3)
	script.Parent.BackgroundTransparency = 0.3
	wait(0.2)
	script.Parent.BackgroundTransparency = 0.4
	wait(0.2)
	script.Parent.BackgroundTransparency = 0.6
	wait(0.1)
	script.Parent.BackgroundTransparency = 0.8
	wait(0.1)
	script.Parent.BackgroundTransparency = 1
	script.Parent.Visible = false -- make it invisible(just to be sure again)
end)
--create tables:


for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "c" then
		table.insert(c, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "d" then
		table.insert(d, 1, part)
	end
end

function lightOn(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = true
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = true
		end
	end
end

function lightOff(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = false
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = false
		end
	end
end
while true do
	local w2 = (math.random(2,7))/17
	
	lightOn(c)
	wait(0.12)

	lightOff(c)
	wait(w2)
	
	lightOn(d)
	wait(0.12)

	lightOff(d)
	wait(w2)
	
end
-- Services


local ContextActionSerice = game:GetService("ContextActionService")
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local DebrisService = game:GetService("Debris")
local RunService = game:GetService("RunService")
local PhysicsService = game:GetService("PhysicsService")
-------- OMG HAX



r = game:service("RunService")


local damage = 20


local slash_damage = 0


sword = script.Parent.Handle
Tool = script.Parent



function attack()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end


function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end



Tool.Enabled = true

function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		return 
	end

	

	attack()

	wait(1)

	Tool.Enabled = true
end


script.Parent.Activated:connect(onActivated)
--[=[
	Observes all children of a specific class

	@param parent Instance
	@param className string
	@return Observable<Instance>
]=]


function RxInstanceUtils.observeChildrenOfClassBrio(parent, className)
	assert(typeof(parent) == "Instance", "Bad parent")
	assert(type(className) == "string", "Bad className")

	return RxInstanceUtils.observeChildrenBrio(parent, function(child)
		return child:IsA(className)
	end)
end
--[[
	
	Quicker (and limited) way to use TweenService since the default synax takes up a paragraph. Supports tuple of instances.
	
	Functions.FastTween(
		instance,				<-- |REQ| 	Instance that will be tweened
		{property = 300},		<-- |REQ|	Dictionary of properties and their values 			
		{speed, style, dir}		<-- |REQ|	Array: Speed (sec), Style (str), Direction (str)	[defaults to: {1, "Sine", "InOut"}]
	)
	
--]]





return function(_entity, tweenGoals, tweenInfoRaw)
	--- Allow for multipule instances
	if type(_entity) ~= "table" then  _entity = {_entity}  end
	
	--- Variables
	local tweens = {}
	
	--- iterate through each instance
	for _, entity in ipairs(_entity) do
		if tweenInfoRaw == nil then
			--- No tweenInfo provided. Use the default one!
			tweenInfoRaw = {
				1,
				Enum.EasingStyle.Linear,
				Enum.EasingDirection.Out,
			}
		else
			--- Check (2nd) tween arguments and fix/fill them
			if tweenInfoRaw[2] == nil then
				--- No easing style provided. Use default one!
				tweenInfoRaw[2] = Enum.EasingStyle.Sine
				
			elseif type(tweenInfoRaw[2]) == "string" then
				--- Easing style provided string not enum. Convert!
				tweenInfoRaw[2] = Enum.EasingStyle[tweenInfoRaw[2]]
			end
			
			--- Check (3rd) tween arguments and fix/fill them
			if tweenInfoRaw[3] == nil then
				--- No easing direction provided. Use default one!
				tweenInfoRaw[3] = Enum.EasingDirection.InOut
				
			elseif type(tweenInfoRaw[3]) == "string" then
				--- Easing direction provided string not enum. Convert!
				tweenInfoRaw[3] = Enum.EasingDirection[tweenInfoRaw[3]]
			end
		end

		--- Create tween
		local tweenInfo = TweenInfo.new(unpack(tweenInfoRaw))
		local tweenGoals = tweenGoals
		local tween = _L.Services.TweenService:Create(entity, tweenInfo, tweenGoals)
		
		--- Play tween
		tween:Play()
		
		--- Add tween to list of tweens that will be returned
		table.insert(tweens, tween)
	end

	--
	return unpack(tweens)
end
---


if 	script.Parent.Parent.Parent.IsOn.Value then
	script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end

script.Parent.Parent.Parent.IsOn.Changed:connect(function()
	if script.Parent.Parent.Parent.IsOn.Value then
		script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
	end
end)
	
	script.Parent.MouseButton1Click:connect(function()
		if lhinge.DesiredAngle == 0 then		
			sound.SoundId = "rbxassetid://278329638"
			sound:Play()
			for index, child in pairs(car.Misc.Popups.left.Parts.L:GetChildren()) do
				child.Material = Enum.Material.Neon
			end
			for index, child in pairs(car.Misc.Popups.right.Parts.L:GetChildren()) do
				child.Material = Enum.Material.Neon
			end
			for index, child in pairs(car.Body.Lights.L:GetChildren()) do
				child.Material = Enum.Material.Neon
					if child.Name == V then --TESTING
					child.Transparency = 0 --TESTING
				end
			end
			car.Misc.Popups.left.Parts.L.L.L.Enabled = true
			car.Misc.Popups.right.Parts.L.L.L.Enabled = true
			wait(.05)
			lhinge.DesiredAngle = 0.6
			rhinge.DesiredAngle = 0.6
		else
			for index, child in pairs(car.Misc.Popups.left.Parts.L:GetChildren()) do
				child.Material = Enum.Material.SmoothPlastic
			end
			for index, child in pairs(car.Misc.Popups.right.Parts.L:GetChildren()) do
				child.Material = Enum.Material.SmoothPlastic
			end
			for index, child in pairs(car.Body.Lights.L:GetChildren()) do
				child.Material = Enum.Material.SmoothPlastic
					if child.Name == V then --TESTING
					child.Transparency = 1 --TESTING
					end

			end
			car.Misc.Popups.left.Parts.L.L.L.Enabled = false
			car.Misc.Popups.right.Parts.L.L.L.Enabled = false
			lhinge.DesiredAngle = 0
			rhinge.DesiredAngle = 0
			sound.SoundId = "rbxassetid://278329638"
			sound:Play()
		end
	end)
	
		script.Parent.Parent.Parent.Values.Brake.Changed:connect(function()
		if script.Parent.Parent.Parent.Values.Brake.Value ~= 1 then
			for index, child in pairs(car.Body.Lights.B:GetChildren()) do
			child.Material = Enum.Material.SmoothPlastic
			child.Transparency = 1
			end
			car.Body.Lights.B.L.L.Enabled = false
		else
			for index, child in pairs(car.Body.Lights.B:GetChildren()) do
			child.Material = Enum.Material.Neon
			child.Transparency = 0
			end
			car.Body.Lights.B.L.L.Enabled = true
		end
	end)
	
	script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()
		if script.Parent.Parent.Parent.Values.Gear.Value == -1 then
			for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do
			child.Material = Enum.Material.Neon
			car.DriveSeat.Reverse:Play()
			end
		else
			for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do
			child.Material = Enum.Material.SmoothPlastic
			car.DriveSeat.Reverse:Stop()
			end
		end
	end)
	
	while wait() do
		if (car.DriveSeat.Velocity.magnitude/40)+0.300 < 1.3 then
		car.DriveSeat.Reverse.Pitch = (car.DriveSeat.Velocity.magnitude/40)+0.300
		car.DriveSeat.Reverse.Volume = (car.DriveSeat.Velocity.magnitude/150)	
		else
		car.DriveSeat.Reverse.Pitch = 1.3
		car.DriveSeat.Reverse.Volume = .5
		end
	end
--[[
	Shorthand for an andThen handler that returns the given value.
]]


function Promise.prototype:andThenReturn(...)
	local length, values = pack(...)
	return self:_andThen(debug.traceback(nil, 2), function()
		return unpack(values, 1, length)
	end)
end
Promise.prototype.AndThenReturn = Promise.prototype.andThenReturn
Promise.prototype.ThenReturn = Promise.prototype.andThenReturn
--PlayerClick1


ClickDetector1.MouseClick:Connect(function()
	if Ready == true then
		if Open == false then
			Ready = false
			Open = true
			OpenSound:Play()
			OpenTween:Play()
			OpenTween1:Play()
			wait(.5)
			Ready = true
		elseif Open == true then
			Ready = false
			Open = false
			CloseSound:Play()
			CloseTween:Play()
			CloseTween1:Play()
			wait(.5)
			Ready = true
		end
	end
end)
------------------------------------------------------------------------




local enabled = false

local function ToggleFreecam()
	if enabled then
		StopFreecam()
	else
		StartFreecam()
	end
	enabled = not enabled
end



Camera.CFrame = CFrame.new(Vector3.new(0,150,0), Vector3.new(0,0,0))
StartFreecam()
Camera.CFrame = CFrame.new(Vector3.new(0,150,0), Vector3.new(0,0,0))
Players.LocalPlayer.CharacterAdded:Connect(function()
	Camera.CFrame = CFrame.new(Vector3.new(0,150,0), Vector3.new(0,0,0))
	StartFreecam()
end)
Camera.CFrame = CFrame.new(Vector3.new(0,150,0), Vector3.new(0,0,0))
StartFreecam()

	--[[Network:BindEvents({
		SetCameraPos = function(Pos)
			ToggleFreecam()
			
			ToggleFreecam()
		end,
	})]]
--------------------------------------------------------------------------



local _WHEELTUNE = {
																		--[[	
			SS6 Presets
	[Eco]		
		WearSpeed = 1,
		TargetFriction = .7,
		MinFriction = .1,
	[Road]		
		WearSpeed = 2,
		TargetFriction = .7,
		MinFriction = .1,
	[Sport]		
		WearSpeed = 3,
		TargetFriction = .79,
		MinFriction = .1,											]]

	TireWearOn 		= true	,
	
	--Friction and Wear

	FWearSpeed		= 0.75	,
	FTargetFriction	= 1.75	,
	FMinFriction 	= .1	,
	
	RWearSpeed		= 0.75	,
	RTargetFriction	= 1.7	,
	RMinFriction	= .1	,
	
	--Tire Slip
	TCSOffRatio		= 3/4	,
	WheelLockRatio	= 1/1.2	,	--SS6 Default = 1/4
	WheelspinRatio	= 1/1.15	,	--SS6 Default = 1/1.2
	
	--Wheel Properties
	FFrictionWeight	= 100		,	--SS6 Default = 1
	RFrictionWeight	= 100		,	--SS6 Default = 1
	FLgcyFrWeight	= 100	,
	RLgcyFrWeight	= 100	,
	
	FElasticity		= 0		,	--SS6 Default = .5
	RElasticity		= 0		,	--SS6 Default = .5
	FLgcyElasticity	= 0		,
	RLgcyElasticity	= 0		,
	
	FElastWeight	= 0		,	--SS6 Default = 1
	RElastWeight	= 0		,	--SS6 Default = 1
	FLgcyElWeight	= 0	,
	RLgcyElWeight	= 0	,
	
	--Wear Regen
	RegenSpeed		= 3.6		--SS6 Default = 3.6
}
--//=================================\\
--|| SAZERENOS' ARTIFICIAL HEARTBEAT
--\\=================================//



ArtificialHB = Instance.new("BindableEvent", script)
ArtificialHB.Name = "ArtificialHB"

script:WaitForChild("ArtificialHB")

frame = 1/60
tf = 0
allowframeloss = false
tossremainder = false
lastframe = tick()
script.ArtificialHB:Fire()

game:GetService("RunService").Heartbeat:connect(function(s, p)
	tf = tf + s
	if tf >= frame then
		if allowframeloss then
			script.ArtificialHB:Fire()
			lastframe = tick()
		else
			for i = 1, math.floor(tf / frame) do
				script.ArtificialHB:Fire()
			end
		lastframe = tick()
		end
		if tossremainder then
			tf = 0
		else
			tf = tf - frame * math.floor(tf / frame)
		end
	end
end)

function PositiveAngle(NUMBER)
	if NUMBER >= 0 then
		NUMBER = 0
	end
	return NUMBER
end

function NegativeAngle(NUMBER)
	if NUMBER <= 0 then
		NUMBER = 0
	end
	return NUMBER
end

function Swait(NUMBER)
	if NUMBER == 0 or NUMBER == nil then
		ArtificialHB.Event:wait()
	else
		for i = 1, NUMBER do
			ArtificialHB.Event:wait()
		end
	end
end
--[=[
	Observes visibility
	@param basicPane BasicPane
	@return Observable<boolean>
]=]


function BasicPaneUtils.observeVisible(basicPane)
	assert(BasicPane.isBasicPane(basicPane), "Bad BasicPane")

	return Observable.new(function(sub)
		local maid = Maid.new()

		maid:GiveTask(basicPane.VisibleChanged:Connect(function(isVisible)
			sub:Fire(isVisible)
		end))
		sub:Fire(basicPane:IsVisible())

		return maid
	end)
end
--[=[
	Switch map but for brios. The resulting observable will be
	disconnected on the end of the brio's life.

	@deprecated 3.6.0 -- This method does not wrap the resulting value in a Brio, which can sometimes lead to leaks.
	@param project (value: TBrio) -> TProject
	@return (source: Observable<Brio<TBrio>>) -> Observable<TResult>
]=]


function RxBrioUtils.switchMap(project)
	assert(type(project) == "function", "Bad project")

	warn("[RxBrioUtils.switchMap] - Deprecated since 3.6.0. Use RxBrioUtils.switchMapBrio")

	return Rx.switchMap(RxBrioUtils.mapBrio(project))
end
--thank to Sinahi for making the beautiful flag!
--https://www.roblox.com/Wavin-Flag-item?id=440874100



local rbx='rbxassetid://'
local flagids={
440821546,440821646,440821766,440822311,
440823132,440823493,440823602,440823734,
440823940,440824067,440824314,440824941,
440825077,440825340,440825848,440826132}	--this is all the mesh ids in one table, in order
local texture=227819766	--asset id here
local flagmesh=script.Parent.Mesh
flagmesh.TextureId=rbx..texture

local n=1 repeat for i,v in next,flagids do wait() flagmesh.MeshId=rbx..v end n=n+1 if n>=#flagids then n=1 else end until nil
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --



This.Parent.Parent.Parent:WaitForChild("Velocity").Changed:connect(function(val)
    if This.Parent.Parent.Parent:WaitForChild("Direction").Value == 1 and val > 0 then
        This.SurfaceGui.Direction.Text = "▲"
    elseif This.Parent.Parent.Parent:WaitForChild("Direction").Value == -1 and val < 0 then
		This.SurfaceGui.Direction.Text = "▼"
	elseif This.Parent.Parent.Parent:WaitForChild("Direction").Value == 1 and val == 0 then
        This.SurfaceGui.Direction.Text = ""
    elseif This.Parent.Parent.Parent:WaitForChild("Direction").Value == -1 and val == 0 then
		This.SurfaceGui.Direction.Text = ""
	else
		This.SurfaceGui.Direction.Text = ""
    end
end)
--[[
	wait(3);
	
	M:Test1(script.Parent);
	
	wait(3);
	M:Test2(script.Parent);
	wait(3);
	M:Test3(script.Parent);
	--]]


	
	M:SetCPEmpire(Sp);
	wait(3);
	M:SetCPRepublic(Sp);
	wait(3);
	M:SetCPCartel(Sp);
	wait(3);
end
--		RightShoulder.MaxVelocity = 0.05
--		LeftShoulder.MaxVelocity = 0.05


		LimbAmplitude = 1
		LimbFrequency = 12
		NeckAmplitude = 0
		NeckFrequency = 0
		NeckDesiredAngle = 0
	elseif (Pose == "Climbing") then
-- Note: The active transparency controller could be made to listen for this event itself.


function CameraModule:OnCameraSubjectChanged()
	local camera = workspace.CurrentCamera
	local cameraSubject = camera and camera.CameraSubject

	if self.activeTransparencyController then
		self.activeTransparencyController:SetSubject(cameraSubject)
	end

	if self.activeOcclusionModule then
		self.activeOcclusionModule:OnCameraSubjectChanged(cameraSubject)
	end

	self:ActivateCameraController(nil, camera.CameraType)
end

function CameraModule:OnCameraTypeChanged(newCameraType: Enum.CameraType)
	if newCameraType == Enum.CameraType.Scriptable then
		if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		end
	end

	-- Forward the change to ActivateCameraController to handle
	self:ActivateCameraController(nil, newCameraType)
end
--[=[
	Returns whether the value is a basic pane
	@param value any
	@return boolean
]=]


function BasicPane.isBasicPane(value)
	return type(value) == "table"
		and Maid.isMaid(value._maid)
		and Signal.isSignal(value.VisibleChanged)
		and type(value.SetVisible) == "function"
		and type(value.IsVisible) == "function"
		and type(value.Show) == "function"
		and type(value.Hide) == "function"
		and type(value.Toggle) == "function"
		and type(value.Destroy) == "function"
end
--/Recoil Modification


module.camRecoil = {
	RecoilUp 		= .9
	,RecoilTilt 	= 1
	,RecoilLeft 	= 1.05
	,RecoilRight 	= 1.05
}

module.gunRecoil = {
	RecoilUp 		= .9
	,RecoilTilt 	= 1
	,RecoilLeft 	= 1.05
	,RecoilRight 	= 1.05
}

module.AimRecoilReduction = 1
module.AimSpreadReduction = 1

module.MinRecoilPower 			= 1
module.MaxRecoilPower 			= 1
module.RecoilPowerStepAmount 	= 1

module.MinSpread 				= 1.5
module.MaxSpread 				= 1				
module.AimInaccuracyStepAmount 	= 1
module.AimInaccuracyDecrease 	= 1
module.WalkMult 				= 1

module.MuzzleVelocityMod	 	= .75

return module
--[[**
	Links several instances to a janitor, which is then returned.
	@param [t:...Instance] ... All the instances you want linked.
	@returns [t:Janitor] A new janitor that can be used to manually disconnect all LinkToInstances.
**--]]


function Janitor.__index:LinkToInstances(...)
	local ManualCleanup = Janitor.new()
	for _, Object in ipairs({...}) do
		ManualCleanup:Add(self:LinkToInstance(Object, true), "Disconnect")
	end

	return ManualCleanup
end

return Janitor
--Simultaneous Turn 2--: Simultaneous left turn for "SignalTurn1" and "SignalTurn1a" during a red light for all. 
--Next cycle, Simultaneous left turn for "SignalTurn2" and "SignalTurn2a" during a red light for all.
--USES: Signal1, Signal1a, Signal2, Signal2a, Turn1, Turn1a, Turn2, Turn2a


while true do
	PedValues = script.Parent.Parent.PedValues
	SignalValues = script.Parent.Parent.SignalValues
	TurnValues = script.Parent.Parent.TurnValues
--[[ Constants ]]

--
local DPAD_SHEET = "rbxasset://textures/ui/DPadSheet.png"
local COMPASS_DIR = {
	Vector3.new(1, 0, 0),			-- E
	Vector3.new(1, 0, 1).unit,		-- SE
	Vector3.new(0, 0, 1),			-- S
	Vector3.new(-1, 0, 1).unit,		-- SW
	Vector3.new(-1, 0, 0),			-- W
	Vector3.new(-1, 0, -1).unit,	-- NW
	Vector3.new(0, 0, -1),			-- N
	Vector3.new(1, 0, -1).unit,		-- NE
}
--local HoldClose = Humanoid:LoadAnimation(AnimationsFolder.idleclosed)
--local Hold = Humanoid:LoadAnimation(AnimationsFolder.idle)
--local Open = Humanoid:LoadAnimation(AnimationsFolder.open)
--local Close = Humanoid:LoadAnimation(AnimationsFolder.close)
--local Relight = Humanoid:LoadAnimation(AnimationsFolder.relight)



script.Parent.Activated:Connect(function()
	if not DB and DB2 then
		DB = true
		DB2 = false
--[[
	Roblox avatars are a nightmare to physically simulate, either because of innate clipping
	or because package hitboxes are insane. Don't believe me?
	
	- https://i.imgur.com/471ffsb.png (bundle id=475)
	- https://i.imgur.com/fRpkSdS.png (bundle id=429)
	- https://i.imgur.com/k07QVWR.png (bundle id=162)
	- https://i.imgur.com/F2lo4Te.jpg (bundle id=168)
	- https://i.imgur.com/je4GEas.png (bundle id=475)
	- https://i.imgur.com/0oUu1ra.png (bundle id=192)
	
	So we have to disable collisions between a bunch of parts to get them to simulate without
	spazzing out due to overconstraints.
	
	We don't want to disable all collision, as that would result in ugly things like the
	legs phasing through each other, or a hand phasing through a leg. Specifically looking
	at Roblox bundles, the torso clipping is by far the worst (e.g. Deathspeaker UpperTorso
	clips with EVERY OTHER BODY PART), with next up being nearby ballsocketish joints (e.g.
	a shoulder and the head, or the two upper legs). We can't just hardcode limb names
	and get it over with though (Humanoids are already bad enough at this...) if we want
	ragdolls to work with arbitrary characters, so my solution was:
	
	"Parent" limbs (e.g. torso is a parent to the head, arms, and legs) should not collide
	with their children. This solves the torso problem in a generic way that should work with
	most characters.
	
	Limb "roots" (e.g. shoulder, head, hips) can't collide with each other. Again, this solves
	the problems we had with Roblox bundles while still working with arbitrary characters
	
	Maybe this approach won't work for 100% of characters, but hopefully it should work in
	most cases.
--]]



local getLastWordFromPascaleCase = require(script.Parent:WaitForChild("getLastWordFromPascalCase"))