Roblox/luau_corpus huggingface dataset:
--// Event Connections
placeEvent.OnServerEvent:connect(function(plr,newPos,what)

 local char =	plr.Character

	if not newRope then
			new = Instance.new('Part')
			new.Parent = workspace
			new.Anchored = true
			new.CanCollide = false
			new.Size = Vector3.new(0.2,0.2,0.2)
			new.BrickColor = BrickColor.new('Black')
			new.Material = Enum.Material.Metal
			new.Position = newPos + Vector3.new(0,new.Size.Y/2,0)
			
			local newW = Instance.new('WeldConstraint')
			newW.Parent = new
			newW.Part0 = new
			newW.Part1 = what
			new.Anchored = false
			
			newAtt0 = Instance.new('Attachment')
			newAtt0.Parent = char.Torso
			newAtt0.Position = Vector3.new(0,-.75,0)
			newAtt1 = Instance.new('Attachment')
			newAtt1.Parent = new
			
			newRope = Instance.new('RopeConstraint')
			newRope.Attachment0 = newAtt0
			newRope.Attachment1 = newAtt1
			newRope.Parent = char.Torso
			newRope.Length = 20
			newRope.Restitution = 0.3
			newRope.Visible = true
			newRope.Thickness = 0.1
			newRope.Color = BrickColor.new("Black")

		placeEvent:FireClient(plr,new)
	end
end)

ropeEvent.OnServerEvent:connect(function(plr,dir,held)
	if newRope then
		newDir = dir
		isHeld = held
	end
end)

cutEvent.OnServerEvent:connect(function(plr)
	if newRope then
		newRope:Destroy()
		newRope = nil
		new:Destroy()
		newAtt0:Destroy()
		newAtt1:Destroy()
	end
end)
-- functions

local function TrackPlayer(player, color)
	local character	= player.Character
	local humanoid	= character:WaitForChild("Humanoid")
	local armor		= humanoid:WaitForChild("Armor")
	local down		= humanoid:WaitForChild("Down")
	
	local frame		= script.SquadFrame:Clone()
		frame.NameLabel.Text		= player.Name
		frame.NameLabel.TextColor3	= color
		frame.Parent				= SQUAD_GUI
	
	local function Update()
		frame.Bars.Health.Size	= UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 0.6, -1)
		frame.Bars.Armor.Size	= UDim2.new(armor.Value / 150, 0, 0.4, -1)
		
		frame.Bars.Health.BackgroundColor3	= down.Value and DOWN_COLOR or HEALTH_COLOR
		frame.DownLabel.Visible	= down.Value
	end
	
	humanoid.HealthChanged:connect(Update)
	armor.Changed:connect(Update)
	down.Changed:connect(function()
		if down.Value then
			script.DownSound:Play()
		end
		
		Update()
	end)
	
	Update()
end

script.TrackPlayer.Event:connect(TrackPlayer)
--[Script]--
StunsValue.Changed:Connect(function()
	if StunsValue.Value >= 30 then  -- change this to the amount of stuns it takes to trigger BloodHour
		workspace.BHStart:Play();
		script.Parent.BHAnimation.Disabled = false;
		StunsValue.Value = 0;
		BHValue.Value = true;
		script.Parent.Head.Eye1.Color = Color3.fromRGB(255, 0, 0);
		script.Parent.Head.Eye2.Color = Color3.fromRGB(255, 0, 0);
		script.Parent.Configuration.WalkSpeed.Value = 0
		script.Parent.Configuration.RunSpeed.Value = 0
		script.Parent.Configuration.Damage.Value = 10000
		script.Disabled = true
		wait(34)
		BHText.Value = 2
		workspace.BHChase:Play()
		wait(2)
		script.Parent.Head.Screaming:Play()
		script.Parent.Configuration.WalkSpeed.Value = 22
		script.Parent.Configuration.RunSpeed.Value = 55
		script.Parent.Configuration.Damage.Value = 90
		wait(50) --End BloodHour change to what you want
		workspace.BHChase:Stop()
        game.Lighting.BHColor.Enabled = false
        game.Lighting.Ambient = Color3.fromRGB(255, 255, 255)
        game.Lighting.FogColor = Color3.fromRGB(255, 255, 255)
		script.Parent.BHAnimation.Disabled = true;
		BHValue.Value = false;
		BHEndValue.Value = false;
		BHText.Value = 0
		Stunning.Value = false
		StunsValue.Value = 0
        game.Workspace.BHChase:Stop()
		script.Parent.Head.Screaming:Stop()
		script.Parent.Configuration.WalkSpeed.Value = 12;
		script.Parent.Configuration.RunSpeed.Value = 25;
		script.Parent.Configuration.Damage.Value = 30;
		script.Parent.Head.Eye1.Color = Color3.fromRGB(255, 255, 255); -- eye color --
		script.Parent.Head.Eye2.Color = Color3.fromRGB(255, 255, 255); -- eye color --
		script.Disabled = false;
	end
end)
--[[Handlebars]]--
	Tune.SteerAngle		= 20		-- Handlebar angle at max lock (in degrees)
	Tune.MSteerExp		= 1 		-- Mouse steering exponential degree
	Tune.LowSpeedCut	= 60 		-- Low speed steering cutoff, tune according to your full lock, a bike with a great handlebar lock angle will need a lower value (E.G. If your full lock is 20 your cutoff will be 40/50, or if your full lock is 40 your cutoff will be 20/30)
	
	Tune.SteerD			= 50 		-- Dampening of the Low speed steering
	Tune.SteerMaxTorque	= 4000 		-- Force of the the Low speed steering
	Tune.SteerP			= 500 		-- Aggressiveness of the the Low speed steering
--Right.InputChanged:Connect(RightTurn)

local function TouchThrottle(input, GPE)
	if input.UserInputState == Enum.UserInputState.Begin and _IsOn then
		_InThrot = 1
	else
		_InThrot = _Tune.IdleThrottle/100
	end
end
Gas.InputBegan:Connect(TouchThrottle)
Gas.InputEnded:Connect(TouchThrottle)
--[[
	Create a copy of a list where each value is transformed by `callback`
]]
function Functional.Map(list, callback)
	local new = {}

	for key = 1, #list do
		new[key] = callback(list[key], key)
	end

	return new
end
--== Primary logic ==--
modifierPressed 	= false
primaryPressed 	= false
debouncer 			= false

inputService.InputChanged:connect(function(winput,processed)
	if processed == false then -- checks to see if you're focused on a textbox or not
		local pressedkeys = inputService:GetKeysPressed()
		
		for _, input in pairs (pressedkeys) do -- iterate all keys currently pressed
			if input.KeyCode == modifierKey then
				modifierPressed = true
			end
			if input.KeyCode == primaryKey then
				primaryPressed = true
			end
			if primaryPressed and modifierPressed then break end -- escapes loop
		end
		
		if primaryPressed == true and modifierPressed == true and debouncer == false then
			debouncer 			= true
			if script.Parent.IsOn.Value == false then StartCar() else StopCar() end
			primaryPressed 	= false
			modifierPressed	= false
			wait(2)
			debouncer = false
		end
	end
end)

script.Parent.IsOn.Changed:Connect(function()
	script.Parent.IgnitionStatus.Text = script.Parent.IsOn.Value and "Engine On" or "Engine Off"
end)
--[[

	remoteProperty = RemoteProperty.new(value: any [, overrideClass: string])

	remoteProperty:Get(): any
	remoteProperty:Set(value: any): void
	remoteProperty:Replicate(): void   [Only for table values]
	remoteProperty:Destroy(): void

	remoteProperty.Changed(newValue: any): Connection

--]]


local Signal = require(script.Parent.Parent.Signal)

local IS_SERVER = game:GetService("RunService"):IsServer()

local typeClassMap = {
	boolean = "BoolValue";
	string = "StringValue";
	table = "RemoteEvent";
	CFrame = "CFrameValue";
	Color3 = "Color3Value";
	BrickColor = "BrickColorValue";
	number = "NumberValue";
	Instance = "ObjectValue";
	Ray = "RayValue";
	Vector3 = "Vector3Value";
	["nil"] = "ObjectValue";
}


local RemoteProperty = {}
RemoteProperty.__index = RemoteProperty


function RemoteProperty.Is(object)
	return (type(object) == "table" and getmetatable(object) == RemoteProperty)
end


function RemoteProperty.new(value, overrideClass)

	assert(IS_SERVER, "RemoteProperty can only be created on the server")

	if (overrideClass ~= nil) then
		assert(type(overrideClass) == "string", "OverrideClass must be a string; got " .. type(overrideClass))
		assert(overrideClass:match("Value$"), "OverrideClass must be of super type ValueBase (e.g. IntValue); got " .. overrideClass)
	end

	local t = typeof(value)
	local class = overrideClass or typeClassMap[t]
	assert(class, "RemoteProperty does not support type \"" .. t .. "\"")

	local self = setmetatable({
		_value = value;
		_type = t;
		_isTable = (t == "table");
		_object = Instance.new(class);
	}, RemoteProperty)

	if (self._isTable) then
		local req = Instance.new("RemoteFunction")
		req.Name = "TableRequest"
		req.Parent = self._object
		function req.OnServerInvoke(_player)
			return self._value
		end
		self.Changed = Signal.new()
	else
		self.Changed = self._object.Changed
	end

	self:Set(value)

	return self

end


function RemoteProperty:Replicate()
	if (self._isTable) then
		self:Set(self._value)
	end
end


function RemoteProperty:Set(value)
	if (self._isTable) then
		self._object:FireAllClients(value)
		self.Changed:Fire(value)
	else
		self._object.Value = value
	end
	self._value = value
end


function RemoteProperty:Get()
	return self._value
end


function RemoteProperty:Destroy()
	self._object:Destroy()
end


return RemoteProperty
-- Connection class
local Connection = {}
Connection.__index = Connection

export type SignalConnection = typeof(setmetatable(
	{} :: {
		_connected: boolean,
		_signal: ClassType,
		_fn: Callback,
		_next: SignalConnection?,
	},
	Connection
))

function Connection.new(signal: ClassType, fn: Callback): SignalConnection
	local self = {
		_connected = true,
		_signal = signal,
		_fn = fn,
		_next = nil,
	}

	setmetatable(self, Connection)

	return self
end

function Connection.Disconnect(self: SignalConnection)
	assert(self._connected, "Can't disconnect a connection twice.")
	self._connected = false

	-- Unhook the node, but DON'T clear it. That way any fire calls that are
	-- currently sitting on this node will be able to iterate forwards off of
	-- it, but any subsequent fire calls will not hit it, and it will be GCed
	-- when no more fire calls are sitting on it.
	if self._signal._handlerListHead and (self._signal._handlerListHead :: SignalConnection) == self then
		self._signal._handlerListHead = self._next
	else
		local prev = self._signal._handlerListHead
		while prev and prev._next ~= self do
			prev = prev._next
		end
		if prev then
			prev._next = self._next
		end
	end
end
-- Here be dragons
-- luacheck: ignore 212
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local WINDOW_MAX_HEIGHT = 300
local MOUSE_TOUCH_ENUM = { Enum.UserInputType.MouseButton1, Enum.UserInputType.MouseButton2, Enum.UserInputType.Touch }
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------


function onRunning(speed)
	if speed>0.5 then
		playAnimation("walk", 0.1, Humanoid)
		pose = "Running"
	else
		playAnimation("idle", 0.1, Humanoid)
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, Humanoid)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

function onClimbing(speed)
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / 12.0)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if (jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function getTool()	
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

function animateTool()
	
	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, Humanoid)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Humanoid)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid)
		return
	end
end

function moveSit()
	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	RightShoulder:SetDesiredAngle(3.14 /2)
	LeftShoulder:SetDesiredAngle(-3.14 /2)
	RightHip:SetDesiredAngle(3.14 /2)
	LeftHip:SetDesiredAngle(-3.14 /2)
end

local lastTick = 0

function move(time)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = time - lastTick
  	lastTick = time

	local climbFudge = 0
	local setAngles = false

  	if (jumpAnimTime > 0) then
  		jumpAnimTime = jumpAnimTime - deltaTime
  	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
-----------------
--| Constants |--
-----------------

local GRAVITY_ACCELERATION = 196.2

local RELOAD_TIME = tool.Configurations.ReloadTime.Value -- Seconds until tool can be used again
local ROCKET_SPEED = tool.Configurations.RocketSpeed.Value -- Speed of the projectile

local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534'
local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)

local RocketScript = script:WaitForChild('Rocket')
local SwooshSound = script:WaitForChild('Swoosh')
local BoomSound = script:WaitForChild('Boom')

local attackCooldown = tool.Configurations.AttackCooldown.Value
local damage = tool.Configurations.Damage.Value
local reloadTime = tool.Configurations.ReloadTime.Value

local function createEvent(eventName)
	local event = game.ReplicatedStorage:FindFirstChild(eventName)
	if not event then
		event = Instance.new("RemoteEvent", game.ReplicatedStorage)
		event.Name = eventName
	end
	return event
end

local updateEvent = createEvent("ROBLOX_RocketUpdateEvent")
local equipEvent = createEvent("ROBLOX_RocketEquipEvent")
local unequipEvent = createEvent("ROBLOX_RocketUnequipEvent")
local fireEvent = createEvent("ROBLOX_RocketFireEvent")

updateEvent.OnServerEvent:connect(function(player, neckC0, rshoulderC0)
	local character = player.Character
	character.Torso.Neck.C0 = neckC0
	character.Torso:FindFirstChild("Right Shoulder").C0 = rshoulderC0
	gunWeld = character:FindFirstChild("Right Arm"):WaitForChild("RightGrip")
end)

equipEvent.OnServerEvent:connect(function(player)
	player.Character.Humanoid.AutoRotate = false
end)

unequipEvent.OnServerEvent:connect(function(player)
	player.Character.Humanoid.AutoRotate = true
end)
-- Initialization

for _, team in ipairs(Teams:GetTeams()) do
	TeamPlayers[team] = {}
	TeamScores[team] = 0
end
-- Looks for a folder within Workspace.Terrain that contains elements to visualize casts.
local function GetFastCastVisualizationContainer()
	local fcVisualizationObjects = Workspace.Terrain:FindFirstChild(FC_VIS_OBJ_NAME)
	if fcVisualizationObjects ~= nil then
		return fcVisualizationObjects
	end
	
	fcVisualizationObjects = Instance.new("Folder")
	fcVisualizationObjects.Name = FC_VIS_OBJ_NAME
	fcVisualizationObjects.Archivable = false -- TODO: Keep this as-is? You can't copy/paste it if this is false. I have it false so that it doesn't linger in studio if you save with the debug data in there.
	fcVisualizationObjects.Parent = Workspace.Terrain
	return fcVisualizationObjects
end
-- Stores the data for overwrite.
function DataStoreStage:_doStore(name, value)
	assert(type(name) == "string" or type(name) == "number", "Bad name")
	assert(value ~= nil, "Bad value")

	local newValue
	if value == DataStoreDeleteToken then
		newValue = DataStoreDeleteToken
	elseif type(value) == "table" then
		newValue = Table.deepCopy(value)
	else
		newValue = value
	end

	if not self._dataToSave then
		self._dataToSave = {}
	end

	self._dataToSave[name] = newValue
	if self._topLevelStoreSignal then
		self._topLevelStoreSignal:Fire()
	end
end


return DataStoreStage
--[[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		= 4.06			-- 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 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
		--[[ 7 ]]		0.53		,
		--[[ 8 ]]		0.36		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[local iceMesh = Instance.new("SpecialMesh", icePart)
iceMesh.Name = "IceMesh"
iceMesh.MeshType = "FileMesh"
iceMesh.MeshId = "http://www.roblox.com/asset/?id=1290033"
iceMesh.Scale = Vector3.new(0.675, 0.675, 0.675)]]

function wait(TimeToWait)
	if TimeToWait ~= nil then
		local TotalTime = 0
		TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
		while TotalTime < TimeToWait do
			TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
		end
	else
		game:GetService("RunService").Heartbeat:wait()
	end
end

local function DisableMove()
	Humanoid.AutoRotate = false
	if(Humanoid.WalkSpeed~=0)then
		StoredValues = {Humanoid.WalkSpeed,Humanoid.JumpPower}
		Humanoid.WalkSpeed = 0
		Humanoid.JumpPower = 0
	end
    Humanoid:UnequipTools()
    PreventTools = character.ChildAdded:connect(function(Child)
	    wait()
	    if Child:IsA("Tool") and Child.Parent == character then
		    Humanoid:UnequipTools()
	    end
    end)
	DisableJump = Humanoid.Changed:connect(function(Property)
		if Property == "Jump" then
			Humanoid.Jump = false
		end
	end)
	Humanoid.PlatformStand = true
    --Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
end

local function EnableMove()
	Humanoid.AutoRotate = true
	Humanoid.WalkSpeed = StoredValues[1]
	Humanoid.JumpPower = StoredValues[2]
	for i, v in pairs({DisableJump, PreventTools}) do
		if v then
			v:disconnect()
		end
	end
	Humanoid.PlatformStand = false
    --Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
-- Gamepad
-- Stephen Leitnick
-- December 23, 2021


local Trove = require(script.Parent.Parent.Trove)
local Signal = require(script.Parent.Parent.Signal)

local UserInputService = game:GetService("UserInputService")
local HapticService = game:GetService("HapticService")
local GuiService = game:GetService("GuiService")
local RunService = game:GetService("RunService")

local function ApplyDeadzone(value: number, threshold: number): number
	if math.abs(value) < threshold then
		return 0
	end
	return ((math.abs(value) - threshold) / (1 - threshold)) * math.sign(value)
end

local function GetActiveGamepad(): Enum.UserInputType?
	local activeGamepad = nil
	local navGamepads = UserInputService:GetNavigationGamepads()
	if #navGamepads > 1 then
		for _,navGamepad in ipairs(navGamepads) do
			if activeGamepad == nil or navGamepad.Value < activeGamepad.Value then
				activeGamepad = navGamepad
			end
		end
	else
		local connectedGamepads = UserInputService:GetConnectedGamepads()
		for _,connectedGamepad in ipairs(connectedGamepads) do
			if activeGamepad == nil or connectedGamepad.Value < activeGamepad.Value then
				activeGamepad = connectedGamepad
			end
		end
	end
	if activeGamepad and not UserInputService:GetGamepadConnected(activeGamepad) then
		activeGamepad = nil
	end
	return activeGamepad
end

local function HeartbeatDelay(duration: number, callback: () -> nil): RBXScriptConnection
	local start = time()
	local connection
	connection = RunService.Heartbeat:Connect(function()
		local elapsed = time() - start
		if elapsed >= duration then
			connection:Disconnect()
			callback()
		end
	end)
	return connection
end
--[=[
	Observes a value base underneath a parent (last named child).

	@param parent Instance
	@param className string
	@param name string
	@return Observable<Brio<any>>
]=]
function RxValueBaseUtils.observeBrio(parent, className, name)
	return RxInstanceUtils.observeLastNamedChildBrio(parent, className, name)
		:Pipe({
			RxBrioUtils.switchMapBrio(function(valueObject)
				return RxValueBaseUtils.observeValue(valueObject)
			end)
		})
end
--------------------------------------------------------------------
	if backfire == true then
		mouse.KeyDown:connect(function(key)
			if key == camkey and enabled == false then

				local children = car.Body.Exhaust:GetChildren()

				for index, child in pairs(children) do
					if child.Name == "Backfire1" or child.Name == "Backfire2" then
						local effect = script.soundeffect:Clone()
						local effect2 = script.soundeffect:Clone()
						effect.Name = "soundeffectCop"
						effect2.Name = "soundeffectCop"
					effect.Parent = child.Backfire1
					effect2.Parent = child.Backfire2
					end
				end
			elseif key == camkey and enabled == true then
			
			local children = car.Body.Exhaust:GetChildren()

			for index, child in pairs(children) do
				if child.Name == "Backfire1" or child.Name == "Backfire2" then
					
					child.Backfire1.soundeffectCop:Destroy()
					child.Backfire2.soundeffectCop:Destroy()
				end
			end
		end
			car.DriveSeat.ChildRemoved:Connect(function(child)

				if child.Name == "SeatWeld" then
				local descendants = car.Body.Exhaust:GetDescendants()

					for index, descendant in pairs(descendants) do
					if descendant.Name == "soundeffectCop" then
						descendant:Destroy()
					end
				end
			end
		end)
	end)
end