Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Import into a single datastore:


local function importPairsFromTable(origin, destination, interface, warnFunc, methodName, prefix, isOrdered)
	for key, value in pairs(origin) do
		if type(key) ~= "string" then
			warnFunc(("%s: ignored %s > '%s' (key is not a string, but a %s)")
				:format(methodName, prefix, tostring(key), typeof(key)))
		elseif not utf8.len(key) then
			warnFunc(("%s: ignored %s > '%s' (key is not valid UTF-8)")
				:format(methodName, prefix, tostring(key)))
		elseif #key > Constants.MAX_LENGTH_KEY then
			warnFunc(("%s: ignored %s > '%s' (key exceeds %d character limit)")
				:format(methodName, prefix, key, Constants.MAX_LENGTH_KEY))
		elseif type(value) == "string" and #value > Constants.MAX_LENGTH_DATA then
			warnFunc(("%s: ignored %s > '%s' (length of value exceeds %d character limit)")
				:format(methodName, prefix, key, Constants.MAX_LENGTH_DATA))
		elseif type(value) == "table" and #HttpService:JSONEncode(value) > Constants.MAX_LENGTH_DATA then
			warnFunc(("%s: ignored %s > '%s' (length of encoded value exceeds %d character limit)")
				:format(methodName, prefix, key, Constants.MAX_LENGTH_DATA))
		elseif type(value) == "function" or type(value) == "userdata" or type(value) == "thread" then
			warnFunc(("%s: ignored %s > '%s' (cannot store value '%s' of type %s)")
				:format(methodName, prefix, key, tostring(value), type(value)))
		elseif isOrdered and type(value) ~= "number" then
			warnFunc(("%s: ignored %s > '%s' (cannot store value '%s' of type %s in OrderedDataStore)")
				:format(methodName, prefix, key, tostring(value), type(value)))
		elseif isOrdered and value % 1 ~= 0 then
			warnFunc(("%s: ignored %s > '%s' (cannot store non-integer value '%s' in OrderedDataStore)")
				:format(methodName, prefix, key, tostring(value)))
		elseif type(value) == "string" and not utf8.len(value) then
			warnFunc(("%s: ignored %s > '%s' (string value is not valid UTF-8)")
				:format(methodName, prefix, key, tostring(value), type(value)))
		else
			local isValid = true
			local keyPath, reason
			if type(value) == "table" then
				isValid, keyPath, reason = scanValidity(value)
			end
			if isOrdered then
				value = math.floor(value + .5)
			end
			if isValid then
				local old = destination[key]
				destination[key] = value
				if interface and old ~= value then -- hacky block to fire OnUpdate signals
					if isOrdered and interface then -- hacky block to populate internal structures for OrderedDataStores
						if interface.__ref[key] then
							interface.__ref[key].Value = value
							interface.__changed = true
						else
							interface.__ref[key] = {Key = key, Value = interface.__data[key]}
							table.insert(interface.__sorted, interface.__ref[key])
							interface.__changed = true
						end
					end
					interface.__event:Fire(key, value)
				end
			else
				warnFunc(("%s: ignored %s > '%s' (table has invalid entry at <%s>: %s)")
					:format(methodName, prefix, key, getStringPath(keyPath), reason))
			end
		end
	end
end
-- Loading


local CutsceneFolder = workspace.Cutscenes:WaitForChild("first scene") -- The folder that contains the cutscene data (Cameras...)
local Destroy = true -- Destroy folder after loading? you don't want your player to see your cameras floating around!
local NoYield = false -- Generally you want this to be set to false, because loading takes a little bit of time, and you don't want to interact with the cutscene when it's not loaded
local SafeMode = true -- This is adviced to be turned on, especially if the cutscene folder data is too big to load at one frame. when turned on, it loads a camera every frame, not all at once.

local Cutscene = require(CutsceneModule)

local Demo = Cutscene.new(Camera, Looping, Speed, FreezeControls) -- Create cutscene
Demo:Load(CutsceneFolder, Destroy, NoYield, SafeMode) -- Load cutscene data from folder

local PlayOnPartTouch = script:FindFirstChild("PlayOnPartTouch")
local PlayOnPlayerJoin = script:FindFirstChild("PlayOnPlayerJoin")
local PlayOnCharacterAdded = script:FindFirstChild("PlayOnCharacterAdded")
local PlayOnCharacterDied = script:FindFirstChild("PlayOnCharacterDied")
local PlayOnEventFire = script:FindFirstChild("PlayOnEventFire")
local PlayOnRemoteEventFire = script:FindFirstChild("PlayOnRemoteEventFire")
local ProtectTheCharacterWhilePlaying = script:FindFirstChild("ProtectTheCharacterWhilePlaying")
local CharacterProtector = script:FindFirstChild("CharacterProtector")
local Music = script:FindFirstChild("Music")
local StopMusicWhenFinished = script:FindFirstChild("StopMusicWhenFinished")
local StopOnEventFire = script:FindFirstChild("StopOnEventFire")
local StopOnRemoteEventFire = script:FindFirstChild("StopOnRemoteEventFire")
local PlayOnce = script:FindFirstChild("PlayOnce")
local Debounce = script:FindFirstChild("Cooldown")
local OnFinishedRemove = script:FindFirstChild("OnFinishedRemove")
local bin = true
local Player = game:GetService("Players").LocalPlayer
local CutsceneGui = script:FindFirstChild("Cutscene")
--Starting Text


while (game.Workspace.Global_Scripts["Main Script"].EnableTalk.checker.Value == true) do
	wait(2)
	if(game.Workspace.Global_Scripts["Main Script"].EnableTalk.Value == true) then
		text.Text = ""
		while(fade > 0) do
			fade = fade - .05
			image.ImageTransparency = fade
			text.TextTransparency = fade
			frame.BackgroundTransparency = fade
			wait(0.1)
		end
		----------------------------------------------
		
		script.Parent.MouseButton1Click:Connect(function()
 if script.Parent.Parent.Open.Value == false then
  script.Parent.Parent.Open.Value = true
  script.Parent.Parent.GUI_BODY:TweenPosition(UDim2.new(0.45, -390, 0.5, -200),"Out","Quint",1,true)
 else
  script.Parent.Parent.Open.Value = false
  script.Parent.Parent.GUI_BODY:TweenPosition(UDim2.new(0.45, -390, -0.5, -200),"Out","Quint",1,true)
 end
end)

		----- include this script so the text goes up and then down
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]


local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0

script:WaitForChild("Rev")

if not FE then
	for i,v in pairs(car.DriveSeat:GetChildren()) do
		for _,a in pairs(script:GetChildren()) do
			if v.Name==a.Name then v:Stop() wait() v:Destroy() end
		end
	end
	for i,v in pairs(script:GetChildren()) do
		v.Parent=car.DriveSeat
	end
	
	car.DriveSeat.Rev:Play()
	
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		car.DriveSeat.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^0.5
	end
else
	local handler = car.AC6_FE_Sounds
	handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
	handler:FireServer("playSound","Rev")
	local pitch=0
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		pitch = (script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume)
	end
end
--reset


script.Parent.Mode.Value = 1
end
end)

script.Parent.Mode.Changed:connect(function()
if script.Parent.Mode.Value == 1 then
script.Parent.B1.Transparency = 0
script.Parent.Main.Transparency = 1 
script.Parent.B2.Transparency = 1
elseif script.Parent.Mode.Value == 2 then
script.Parent.B1.Transparency = 1
script.Parent.Main.Transparency = 1
script.Parent.B2.Transparency = 0
end
end)

script.Parent.Main.ClickDetector.MouseClick:connect (ChangeMode)
-- obtain goals based on Center part


center.BodyPosition.position = beacon.Center.Position
teamColor = center.Color
vel = center.BodyVelocity

healerIsResting = false

function restHealer()
	healerIsResting = true
	wait(5)
	healerIsResting = false
end

local Team = Instance.new("Team")
Team.TeamColor = BrickColor.new(teamColor)
Team.Name = Team.TeamColor.Name
Team.AutoAssignable = false
function joinTeam(humanoid)
	
	local team = Instance.new("Color3Value")
	team.Value = teamColor
	team.Name = "Team"
	team.Parent = humanoid
	
	local vCharacter = humanoid.Parent
	if vCharacter then
		Team.Parent = game:GetService("Teams")
		local vPlayer = game.Players:GetPlayerFromCharacter(vCharacter) 
		if vPlayer then
			vPlayer.Neutral = false
			vPlayer.TeamColor = BrickColor.new(teamColor)
			
			spawn(function()
				local message = Instance.new("Message")
				message.Text = string.format("You're now on the %s team!", Team.Name)
				message.Parent = vPlayer
				wait(5)
				message.Text =  "Touch the beacon again to heal you!"
				wait(5)
				message:Destroy()
			end)
		end
	end
--[[
	This is a simple signal implementation that has a dead-simple API.

		local signal = createSignal()

		local disconnect = signal:subscribe(function(foo)
			print("Cool foo:", foo)
		end)

		signal:fire("something")

		disconnect()
]]



local function createSignal()
	local connections = {}
	local suspendedConnections = {}
	local firing = false

	local function subscribe(self, callback)
		assert(typeof(callback) == "function", "Can only subscribe to signals with a function.")

		local connection = {
			callback = callback,
			disconnected = false,
		}

		-- If the callback is already registered, don't add to the suspendedConnection. Otherwise, this will disable
		-- the existing one.
		if firing and not connections[callback] then
			suspendedConnections[callback] = connection
		end

		connections[callback] = connection

		local function disconnect()
			assert(not connection.disconnected, "Listeners can only be disconnected once.")

			connection.disconnected = true
			connections[callback] = nil
			suspendedConnections[callback] = nil
		end

		return disconnect
	end

	local function fire(self, ...)
		firing = true
		for callback, connection in pairs(connections) do
			if not connection.disconnected and not suspendedConnections[callback] then
				callback(...)
			end
		end

		firing = false

		for callback, _ in pairs(suspendedConnections) do
			suspendedConnections[callback] = nil
		end
	end

	return {
		subscribe = subscribe,
		fire = fire,
	}
end

return createSignal
-- Functions --



local function playSoundLocal(sId,sParent)
	local sound = Instance.new("Sound",sParent)
	sound.SoundId = "http://www.roblox.com/asset/?id="..sId
	sound:Play()
	sound:Destroy()
end

local function onClicked(player)
	print(player.Name.." clicked on Uniform Giver")

	playSoundLocal(152206246,player)	-- Declaring the sound ID and Parent




	local foundShirt = player.Character:FindFirstChild("Shirt") -- Tries to find Shirt
	if not foundShirt then -- if there is no shirt
		print("No shirt found, creating for "..player.Name)
		local newShirt = Instance.new("Shirt",player.Character)
		newShirt.Name = "Shirt"
	else if foundShirt then -- if there is a shirt
			print("Shirt found, reconstructing for "..player.Name)
			player.Character.Shirt:remove()
			local newShirt = Instance.new("Shirt",player.Character)
			newShirt.Name = "Shirt"
		end
	end




	local foundPants = player.Character:FindFirstChild("Pants") -- Tries to find Pants
	if not foundPants then -- if there are no pants
		print("No pants found, creating for "..player.Name)
		local newPants = Instance.new("Pants",player.Character)
		newPants.Name = "Pants"
	else if foundPants then -- if there are pants
			print("Pants found, reconstructing for "..player.Name)
			player.Character.Pants:remove()
			local newPants = Instance.new("Pants",player.Character)
			newPants.Name = "Pants"
		end
	end

	player.Character.Shirt.ShirtTemplate = shirtId
	player.Character.Pants.PantsTemplate = pantsId
end




local function onHoverEnter(player)
	cPart.Transparency = 1
	cPart.BrickColor = BrickColor.White()
end



local function onHoverLeave(player)
	cPart.BrickColor = BrickColor.Gray()
	cPart.Transparency = 1
end
--[=[
	Cleans up the service bag and all services that have been
	initialized in the service bag.
]=]


function ServiceBag:Destroy()
	local super = getmetatable(ServiceBag)

	self._destroying:Fire()

	local services = self._services
	local key, service = next(services)
	while service ~= nil do
		services[key] = nil

		if not (self._serviceTypesToInitializeSet and self._serviceTypesToInitializeSet[key]) then
			task.spawn(function()
				if service.Destroy then
					service:Destroy()
				end
			end)
		end
		key, service = next(services)
	end

	super.Destroy(self)
end

return ServiceBag
-- Mount the ProfileCard to the playerGui


Roact.mount(
	Roact.createElement(ConfigContext.ConfigurationProvider, {
		config = ProfileCardConfiguration,
	}, {
		ProfileCard = Roact.createElement(ProfileCard, {
			adornee = HumanoidRootPart,
			controls = controls,
		}),
	}),
	playerGui,
	"MountedProfileCard"
)
--Thank U!


game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        local a = Instance.new("PointLight", char.Head)
        a.Range = 17                          --Replace 15 with how far you want the glow to be (15 is probably the best)
        a.Brightness = .9                      --Replace 2 with how bright you want it to be (2 is probably the best)
        a.Color = Color3.new(255, 255, 255)   --Set the color you want it to be (Red, Green, Blue, value divided by 255)(right now it is set to white which is probably the best)
        a.Shadows = true                      --Do you want the light to be seen through bricks? (true is probably, well, the best! ;)
    end)
end)
--[=[
	Creates an immediately rejected Promise with the given value.

	:::caution
	Something needs to consume this rejection (i.e. `:catch()` it), otherwise it will emit an unhandled Promise rejection warning on the next frame. Thus, you should not create and store rejected Promises for later use. Only create them on-demand as needed.
	:::

	@param ... any
	@return Promise<...any>
]=]


function Promise.reject(...)
	local length, values = pack(...)
	return Promise._new(debug.traceback(nil, 2), function(_, reject)
		reject(unpack(values, 1, length))
	end)
end
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	return (plrData.Character.NPCSpecifics.GaveGriefToArtie.Value == false) and (plrData.Character.NPCSpecifics.GaveFoodToArtie.Value == false)
end
--[[
    Returns true if the current state can transition to specified stateName, otherwise returns false.
]]


function StateHolder:canTransition(stateName)
	if not self._allowedTransitions[stateName] then
		Logger.error("State", stateName, "does not exist!")
		return false
	end

	for _, transitionState in pairs(self._allowedTransitions[self.current]) do
		if transitionState == stateName then
			return true
		end
	end

	return false
end

return StateHolder
--[[
	    ___      _______                _       _______
	   / _ |____/ ___/ /  ___ ____ ___ (_)__   /__  __/
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<     / /
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/	/_/   
						SecondLogic @ Inspare
						Avxnturador @ Novena
]]


local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local BOVact = 0
local BOVact2 = 0

local BOV_Loudness = 7	--volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 1 	--max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 3 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)

script:WaitForChild("Whistle")
script:WaitForChild("BOV")

for i,v in pairs(car.DriveSeat:GetChildren()) do
	for _,a in pairs(script:GetChildren()) do
		if v.Name==a.Name then v:Stop() wait() v:Destroy() end
	end
end

car.DriveSeat.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" then
		for i,v in pairs(car.DriveSeat:GetChildren()) do
			for _,a in pairs(script:GetChildren()) do
				if v.Name==a.Name then v:Stop() wait() v:Destroy() end
			end
		end
	end
end)

handler:FireServer("newSound","Whistle",car.DriveSeat,script.Whistle.SoundId,0,script.Whistle.Volume,true)
handler:FireServer("newSound","BOV",car.DriveSeat,script.BOV.SoundId,0,script.BOV.Volume,true)
handler:FireServer("playSound","Whistle")
car.DriveSeat:WaitForChild("Whistle")
car.DriveSeat:WaitForChild("BOV")
local ticc = tick()
local _TCount = 0
if _Tune.Aspiration == "Single" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end

while wait() do
	local psi = (((script.Parent.Values.Boost.Value)/(_Tune.Boost*_TCount))*2)
	
	BOVact = math.floor(psi*20)
	WP = (psi)
	WV = (psi/4)*TurboLoudness
	
	BP = (1-(-psi/20))*BOV_Pitch
	BV = (((-0.5+((psi/2)*BOV_Loudness)))*(1 - script.Parent.Values.Throttle.Value))

	if BOVact < BOVact2 then if car.DriveSeat.BOV.IsPaused then if FE then handler:FireServer("playSound","BOV") else car.DriveSeat.BOV:Play() end end end
	if BOVact >= BOVact2 then if FE then handler:FireServer("stopSound","BOV") else car.DriveSeat.BOV:Stop() end end
	
	if FE then
		handler:FireServer("updateSound","Whistle",script.Whistle.SoundId,WP,WV)
		handler:FireServer("updateSound","BOV",script.BOV.SoundId,BP,BV)
	else
		car.DriveSeat.Whistle.Pitch = WP
		car.DriveSeat.Whistle.Volume = WV
		car.DriveSeat.BOV.Pitch = BP
		car.DriveSeat.BOV.Volume = BV
	end
	if (tick()-ticc) >= 0.1 then
		BOVact2 = math.floor(psi*20)
		ticc = tick()
	end
end
--[[ Modules ]]

--
local ClickToMoveTouchControls = nil
local ControlModules = {}

local ControlState = {}
ControlState.Current = nil
function ControlState:SwitchTo(newControl)
	if ControlState.Current == newControl then return end
	
	if ControlState.Current then
		ControlState.Current:Disable()
	end
	
	ControlState.Current = newControl
	
	if ControlState.Current then
		ControlState.Current:Enable()
	end
end

function ControlState:IsTouchJumpModuleUsed()
	return isJumpEnabled
end

local MasterControl = require(script:WaitForChild('MasterControl'))
--[[Transmission]]


	Tune.TransModes		= {"Semi","Auto"}								--[[
	[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.60		 --	[TRANSMISSION CALCULATIONS FOR NERDS]
	Tune.Ratios			= {			 --		SPEED [SPS]	 = (Wheel diameter(studs) * pi(3.14) * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
		--[[Reverse]]	3.484		,--		WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
		--[[Neutral]]	0			,
		--[[ 1 ]]		3.000      	,
		--[[ 2 ]]		2.022		,
		--[[ 3 ]]		1.384		,
		--[[ 4 ]]		1.000		,
		--[[ 5 ]]		0.861		,
	    --[[ 6 ]]       0.500       ,
	    --[[ 7 ]]       0.320       ,
	}
	Tune.FDMult			= 1.7			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--First build your Gun, make sure all the parts and Non-Colliding and Not Anchored.
--Second put these parts inside the Tool (Call one of the parts 'Handle' and the rest 'Part'
--Lastly, make/get your gun script and test it out! 



local prev 
local parts = script.Parent.PTorso:GetChildren() 

for i = 1,#parts do 
	if (parts[i].className == "Part") or (parts[i].className == "VehicleSeat") then 
		if (prev ~= nil)then 
			local weld = Instance.new("Weld") 
			weld.Part0 = prev 
			weld.Part1 = parts[i] 
			weld.C0 = prev.CFrame:inverse() 
			weld.C1 = parts[i].CFrame:inverse() 
			weld.Parent = prev 
		end 
		prev = parts[i] 
	end 
end
-------------------------------------Gun info


ToolName="Magnum"
ClipSize=12
ReloadTime=1
Firerate=.2
MinSpread=0.000001
MaxSpread=0.00001
SpreadRate=0
BaseDamage=50
automatic=false
burst=false
shot=false			--Shotgun
BarrlePos=Vector3.new(0,0,0)
Cursors={"rbxasset://textures\\GunCursor.png"}
ReloadCursor="rbxasset://textures\\GunWaitCursor.png"
--		if #all_height > 0 then
--			local avg
--			local sum = 0
--			for i=1,#all_height do
--				local _height = all_height[i]
--				sum = sum + _height
--			end
--			avg = sum / #all_height
--			height = avg
--		end


		
		return height
		
	end

	function Pets.Update()
		if Pets.Pet and Pets.Pet.Instance then
			local instance = Pets.Pet.Instance
			if Player.Character and Player.Character.PrimaryPart and Player.PetAttachment then
				local pet_type_data = PetData[Pets.Pet.Data.referenceModel]
				if pet_type_data and instance.PrimaryPart then
					local char_cf = Player.Character.PrimaryPart.CFrame
					local pet_cf = instance.PrimaryPart.CFrame
					local height = Pets:GetHeight(char_cf, instance) or pet_type_data.Offset.p.Y
					local new_cf = pet_type_data.Offset - Vector3.new(0,pet_type_data.Offset.p.Y,0) + Vector3.new(0,height,0)--char_cf:ToWorldSpace(pet_type_data.Offset - Vector3.new(0,pet_type_data.Offset.p.Y,0) + Vector3.new(0,height,0)) 
										
					Player.PetAttachment.CFrame = new_cf		
				end
			end
		end
	end

	Services.RunService.Heartbeat:Connect(Pets.Update)


return Pets