Pinkstack/roblox-luau-corpus-text huggingface dataset:
--// All global vars will be wiped/replaced except script



return function(data)
	local gui = script.Parent.Parent--client.UI.Prepare(script.Parent.Parent)
	local frame = gui.Frame
	local frame2 = frame.Frame
	local msg = frame2.Message
	local ttl = frame2.Title
	
	local gIndex = data.gIndex
	local gTable = data.gTable
	
	local title = data.Title
	local message = data.Message
	local scroll = data.Scroll
	local tim = data.Time
	
	local gone = false
	
	if not data.Message or not data.Title then gTable:Destroy() end
	
	ttl.Text = title
	msg.Text = message
	ttl.TextTransparency = 1
	msg.TextTransparency = 1
	ttl.TextStrokeTransparency = 1
	msg.TextStrokeTransparency = 1
	frame.BackgroundTransparency = 1
	
	local log  = {
		Type = "Small Screen Message";
		Title = title;
		Message = message;
		Icon = "rbxassetid://7501175708";
		Time = os.date("%X");
		Function = nil;
	}

	table.insert(client.Variables.CommunicationsHistory, log) 
	service.Events.CommsPanel:Fire(log)
	
	local fadeSteps = 10
	local blurSize = 10
	local textFade = 0.1
	local strokeFade = 0.5
	local frameFade = 0.3
	
	local blurStep = blurSize/fadeSteps
	local frameStep = frameFade/fadeSteps
	local textStep = 0.1
	local strokeStep = 0.1
	
	local function fadeIn()
		gTable:Ready()
		for i = 1,fadeSteps do
			if msg.TextTransparency>textFade then
				msg.TextTransparency = msg.TextTransparency-textStep
				ttl.TextTransparency = ttl.TextTransparency-textStep
			end
			if msg.TextStrokeTransparency>strokeFade then
				msg.TextStrokeTransparency = msg.TextStrokeTransparency-strokeStep
				ttl.TextStrokeTransparency = ttl.TextStrokeTransparency-strokeStep
			end
			if frame.BackgroundTransparency>frameFade then
				frame.BackgroundTransparency = frame.BackgroundTransparency-frameStep
				frame2.BackgroundTransparency = frame.BackgroundTransparency
			end
			service.Wait("Stepped")
		end
	end
	
	local function fadeOut()
		if not gone then
			gone = true
			for i = 1,fadeSteps do
				if msg.TextTransparency<1 then
					msg.TextTransparency = msg.TextTransparency+textStep
					ttl.TextTransparency = ttl.TextTransparency+textStep
				end
				if msg.TextStrokeTransparency<1 then
					msg.TextStrokeTransparency = msg.TextStrokeTransparency+strokeStep
					ttl.TextStrokeTransparency = ttl.TextStrokeTransparency+strokeStep
				end
				if frame.BackgroundTransparency<1 then
					frame.BackgroundTransparency = frame.BackgroundTransparency+frameStep
					frame2.BackgroundTransparency = frame.BackgroundTransparency
				end
				service.Wait("Stepped")
			end
			service.UnWrap(gui):Destroy()
		end
	end
	
	gTable.CustomDestroy = function()
		fadeOut()
	end
	
	fadeIn()
	if not tim then
		local _,time = message:gsub(" ","")
		time = math.clamp(time/2,4,11)+1
		wait(time)
	else
		wait(tim)
	end
	if not gone then
		fadeOut()
	end
end
--	RightShoulder.MaxVelocity = 0.025
--	LeftShoulder.MaxVelocity = 0.025
--	RightShoulder.DesiredAngle = (math.pi / 2)
--	LeftShoulder.DesiredAngle = -(math.pi / 2)
--	RightHip.DesiredAngle = 1
--	LeftHip.DesiredAngle = -1


end

function Move(Time)
	local LimbAmplitude
	local LimbFrequency
	local NeckAmplitude
	local NeckFrequency
	local NeckDesiredAngle
  
	if (Pose == "Jumping") then
		MoveJump()
		return
	elseif (Pose == "FreeFall") then
		MoveFreeFall()
		return
	elseif (Pose == "Seated") then
		MoveSit()
		return
	end

	local ClimbFudge = 0
	
	if (Pose == "Running") then
--Rears--



for _,v in pairs({
	

	
	
}) do

	local open1=false
	for _,a in pairs(v.Parts:GetChildren()) do
		if a.Name=="Handle" then
			local CL = Instance.new("ClickDetector",a)
			CL.MaxActivationDistance = 8.5
			CL.MouseClick:connect(function()
				open1 = not open1
				if open1 then
					a.DoorOpen:Play()
					wait(0.2)
					a.Parent.Parent.sHinge1.W.DesiredAngle = 1.5
					a.Parent.Parent.sHinge2.W.DesiredAngle = -3
					a.Parent.Parent.sHinge3.W.DesiredAngle = -1.5
					a.Parent.Parent.sHinge4.W.DesiredAngle = 3
				else
					a.Parent.Parent.sHinge1.W.DesiredAngle = 0
					a.Parent.Parent.sHinge2.W.DesiredAngle = 0
					a.Parent.Parent.sHinge3.W.DesiredAngle = 0
					a.Parent.Parent.sHinge4.W.DesiredAngle = 0
					a.DoorClose:Play()
					wait(1.1)
					a.Parent.Parent.oHinge1.W.DesiredAngle = 0
					a.Parent.Parent.oHinge2.W.DesiredAngle = 0
				end
			end)
		end
	end
end
--		print(#labelAs, #labelBs)


		
		local start = tick()
		
		while wait() do
			local alpha = math.min((tick() - start)/speed, 1)
			
			for index,labelA in pairs(labelAs) do
				labelA.Position = UDim2.new(1*index + alpha, 0, 0, 0)
			end
			
			labelM.Position = UDim2.new(alpha, 0, 0, 0)
			
			for index,labelB in pairs(labelBs) do
				labelB.Position = UDim2.new(-1*index + alpha, 0, 0, 0)
			end
		
			if alpha >= 1 then
				break
			end
		end
	end
end
--[[Initialize]]



	script.Parent:WaitForChild("A-Chassis Interface")
	script.Parent:WaitForChild("Plugins")
	script.Parent:WaitForChild("README")
	
	local car=script.Parent.Parent
	local _Tune=require(script.Parent)

	wait(_Tune.LoadDelay)

	--Update Checker
	
	if _Tune.AutoUpdate then
		local newModel 
		local s,m = pcall(function() newModel = game:GetService("InsertService"):LoadAsset(5181235975) end)
		if s then
			local MinorUpdate = false
			local MajorUpdate = false
			local localVersion = script.Parent["A-Chassis Interface"].Version
			local newVersion = newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Version
			if localVersion.Value < newVersion.Value or localVersion.LastMajorUpdate.Value < newVersion.LastMajorUpdate.Value then
				if localVersion.LastMajorUpdate.Value < newVersion.LastMajorUpdate.Value then
					MajorUpdate = true
				else
					MinorUpdate = true
				end
			end
			if MajorUpdate then
				print("[AC6C]: Chassis update!"
						.."\nA major update to A-Chassis 6C has been found."
						.."\nThe changes cannot be ported due to the update."
						.."\nYou are advised to update your chassis ASAP.")
			elseif MinorUpdate then
				localVersion.Value = newVersion.Value
				print("[AC6C]: Drive script update!"
					.."\nAn update to A-Chassis' Drive script has been found."
					.."\nThe updated script will take effect next time you get in."
					.."\nYou are advised to update your chassis soon.")
				script.Parent["A-Chassis Interface"].Drive:Destroy()
				newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Drive.Parent = script.Parent["A-Chassis Interface"]
			end
			newModel:Destroy()
		end
	end

	--Weight Scaling
	local weightScaling = _Tune.WeightScaling

	local Drive=car.Wheels:GetChildren()
	
	--Remove Existing Mass
	function DReduce(p)
		for i,v in pairs(p:GetChildren())do
			if v:IsA("BasePart") then
				if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
				v.CustomPhysicalProperties = PhysicalProperties.new(
					0,
					v.CustomPhysicalProperties.Friction,
					v.CustomPhysicalProperties.Elasticity,
					v.CustomPhysicalProperties.FrictionWeight,
					v.CustomPhysicalProperties.ElasticityWeight
				)
				v.Massless = true --(LuaInt) but it's just this line
			end
			DReduce(v)
		end
	end
	DReduce(car)
-- places a brick at pos and returns the position of the brick's opposite corner


function placeBrick(cf, pos, color)
	local brick = Instance.new("Part")
	brick.BrickColor = color
	brick.CFrame = cf * CFrame.new(pos + brick.Size / 2)
	script.Parent.BrickCleanup:Clone().Parent = brick -- attach cleanup script to this brick
	brick.BrickCleanup.Disabled = false
	brick.Parent = game.Workspace
	brick:MakeJoints()
	return  brick, pos +  brick.Size
end

function buildWall(cf)

	local color = BrickColor.Random()
	local bricks = {}

	assert(wallWidth>0)
	local y = 0
	while y < wallHeight do
		local p
		local x = -wallWidth/2
		while x < wallWidth/2 do
			local brick
			brick, p = placeBrick(cf, Vector3.new(x, y, 0), color)
			x = p.x
			table.insert(bricks, brick)
			wait(brickSpeed)
		end
		y = p.y
	end

	return bricks

end


function snap(v)
	if math.abs(v.x)>math.abs(v.z) then
		if v.x>0 then
			return Vector3.new(1,0,0)
		else
			return Vector3.new(-1,0,0)
		end
	else
		if v.z>0 then
			return Vector3.new(0,0,1)
		else
			return Vector3.new(0,0,-1)
		end
	end
end


Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid then
		return 
	end

	local targetPos = MouseLoc:InvokeClient(game:GetService("Players"):GetPlayerFromCharacter(character))
	local lookAt = snap( (targetPos - character.Head.Position).unit )
	local cf = CFrame.new(targetPos, targetPos + lookAt)

	Tool.Handle.BuildSound:Play()

	buildWall(cf)

	wait(5)

	Tool.Enabled = true
end

Tool.Activated:Connect(onActivated)
--[[
	Set the current node's status to Failure and adds a message to its list of
	errors.
]]


function TestSession:setError(message)
	assert(#self.nodeStack > 0, "Attempting to set error status on empty stack")
	local last = self.nodeStack[#self.nodeStack]
	last.status = TestEnum.TestStatus.Failure
	table.insert(last.errors, message)
end
--This is just some simple server script that moves the object around every frame
--The kinematics module handles the rest



game["Run Service"].Heartbeat:Connect(function(deltaTime)
	
	part.Position = startPos + pos
	
	pos += vel * deltaTime
	
	if (pos.x > boxSize) then
		vel = Vector3.new( -math.abs(vel.x),0,vel.z)
	end
	if (pos.x < -boxSize) then
		vel = Vector3.new( math.abs(vel.x),0,vel.z)
	end
	if (pos.z > boxSize) then
		vel = Vector3.new(vel.x,0, -math.abs(vel.z))
	end
	if (pos.z < -boxSize) then
		vel = Vector3.new(vel.x,0, math.abs(vel.z))
	end
	
	
end)
--Engine Sound stuff


local ShiftLength = 0.35
local OmegaSum = 0
local AvgOmega = 0
local Shifting = false
local ShiftStart = 0
local Gear = 1
local ShiftUp = 1.5
local ShiftDown = 0.85
local OldGear = 1
local EngineSound = script.Parent.Engine
EngineSound:Play()
local function GearRatio(Num)
	return 0.014 / (0.2*Num+ 0.08)
end

while true do
	wait()
	AvgOmega = (OmegaSum/(#Wheels) + AvgOmega)/2 
	OmegaSum = 0
	for i,v in pairs(Wheels) do
		local Wheel = v.Wheel
		--Raycast to find if the wheel is touching the ground
		local OffsetVector = -Base.CFrame.UpVector*Wheel.Size.Y/1.925
		local Hit, Pos, Normal = Raycast.new(Wheel.Position, OffsetVector,script.Parent.Parent)
		--Touching
		if Hit then	
			--Calculate velocity of bottom of wheel
			local Omega = -v.Wheel.CFrame:vectorToObjectSpace(Wheel.RotVelocity).X
			OmegaSum = OmegaSum + math.abs(Omega)
			local ContactVelocity = Wheel.Velocity + Omega * Wheel.Size.Y/2 * Wheel.CFrame.rightVector:Cross(Normal)
			local ObjSpaceVel = Wheel.CFrame:vectorToObjectSpace(ContactVelocity)
			local SlideSpeed = ContactVelocity.magnitude 
			
			--Position Attachments	
			v.AttCenter.Position = AttachmentPart.CFrame:PointToObjectSpace(Pos)
			local PerpVector = AttachmentPart.CFrame:VectorToObjectSpace( (Normal:Cross(Wheel.Velocity).unit ))
			local Offset = PerpVector*0.044*(math.clamp(SlideSpeed-27,0,80))^0.5 + Normal*0.175
			v.AttL.Position = v.AttCenter.Position + Offset
			v.AttR.Position = v.AttCenter.Position - Offset
			v.Smoke.Rate = (math.max(0,SlideSpeed-27))^0.5
			
			--Tyre Sound
			v.DriftSound.Pitch = ( math.clamp(4.1/(SlideSpeed^0.28),0.9,2.2) + v.DriftSound.Pitch*3)/4
			v.DriftSound.Volume = ( math.clamp(0.009*SlideSpeed^1.2,0,2.5) + v.DriftSound.Volume*3)/4
			
			--Engine Sounds
			EngineSound.Volume = 0.1 + 0.4 * math.max(Throttle.Value,0)
			local RawPitch = AvgOmega*GearRatio(Gear)
			if not Shifting then
				if RawPitch > ShiftUp then
					OldGear = Gear
					Gear = Gear + 1
					Shifting = true
					ShiftStart = elapsedTime()
				elseif RawPitch < ShiftDown and Gear > 1 then
					OldGear = Gear
					Gear = Gear - 1
					Shifting = true
					ShiftStart = elapsedTime()
				end
			else
				local pct = (elapsedTime() -ShiftStart)/ShiftLength
				RawPitch = AvgOmega*(pct*GearRatio(Gear) + (1-pct)*GearRatio(OldGear))
				if pct>=1 then
					Shifting = false
				end
			end
			EngineSound.Pitch = math.max(RawPitch,.3)
			
			
			--Enable or disable tyre sounds and trails
			if SlideSpeed > 21 then
				v.Beam.Enabled = true
				v.Smoke.Enabled = true
				if not v.DriftSound.Playing then
					v.DriftSound:Play()
				end
			else
				v.Beam.Enabled = false
				v.Smoke.Enabled = false
				if v.DriftSound.Playing then
					v.DriftSound:Stop()
				end
			end
		else --Airborn
			v.Beam.Enabled = false
			v.Smoke.Enabled = false
			if v.DriftSound.Playing then
				v.DriftSound:Stop()
			end
		end
	end
end
--[[Transmission]]


	Tune.Clutch			= true		-- Implements a realistic clutch, change to "false" for the chassis to act like AC6.81T.

	Tune.TransModes		= {"Auto","Semi","Manual"}												--[[
	[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													]]
	
	Tune.ClutchMode		= "New"												--[[
	[Modes]
		"New"		: Speed controls clutch engagement			(AC6C V1.2)
		"Old"		: Speed and RPM control clutch engagement	(AC6C V1.1)		]]
	
	Tune.ClutchType 	= "Clutch"										--[[
	[Types]
		"Clutch"			: Standard clutch, recommended
		"TorqueConverter"	: Torque converter, keeps RPM up
		"CVT"				: CVT, found in scooters
																		]] 
	--[[Transmission]]
	--Transmission Settings
	Tune.Stall			= true		-- Stalling, enables the car to stall. An ignition plugin would be necessary. Disables if Tune.Clutch is false.
	Tune.ClutchRel		= false		-- If true, the driver must let off the gas before shifting to a higher gear. Recommended false for beginners.
	Tune.ClutchEngage	= 85		-- How fast engagement is (0 = instant, 99 = super slow)	
	Tune.SpeedEngage 	= 18		-- Speed the clutch fully engages at (Based on SPS) 
	
	--Clutch: "Old" mode
	Tune.ClutchRPMMult	= 1.0		-- Clutch RPM multiplier, recommended to leave at 1.0
	
	--Torque Converter:
	Tune.TQLock 		= false		-- Torque converter starts locking at a certain RPM
	
	--Torque Converter and CVT:
	Tune.RPMEngage 		= 3500		-- Keeps RPMs to this level until passed
	
	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM										]]	
	Tune.AutoShiftType	= "DCT"												--[[
	[Types]
		"Rev"		: Clutch engages fully once RPM reached			(AC6C V1)
		"DCT"		: Clutch engages after a set time has passed	(AC6.81T)	]]
	Tune.AutoShiftVers	= "Old"												--[[
	[Versions]
		"New"		: Shift from Reverse, Neutral, and Drive		(AC6.81T)
		"Old"		: Auto shifts into R or D when stopped.			(AC6.52S2)	]]
	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)
	
	--Automatic: Revmatching
	Tune.ShiftThrot		= 100		-- Throttle level when shifting down to revmatch, 0 - 100%
	
	--Automatic: DCT
	Tune.ShiftUpTime	= 0.25		-- Time required to shift into next gear, from a lower gear to a higher one.
	Tune.ShiftDnTime	= 0.125		-- Time required to shift into next gear, from a higher gear to a lower one.
	
	--Gear Ratios
	
	Tune.FinalDrive		= 4
	Tune.Ratios			= {
		--[[Reverse]]	5			,
		--[[Neutral]]	0			,
		--[[ 1 ]]		3.9			,
		--[[ 2 ]]		2.52		,
		--[[ 3 ]]		1.85		,
		--[[ 4 ]]		1.38		,
		--[[ 5 ]]		1.05		,
		--[[ 6 ]]		.87			,
		--[[ 7 ]]		.69			,
	}
	Tune.FDMult			= 1			-- Ratio multiplier (keep this at 1 if car is not struggling with torque)
--print("JeepScript: events connected.")



while true do
	-- Every 15 seconds, poll if jeep has turned upside down.  If true, then flip back upright.
	if(upVectorPart.CFrame.lookVector.y <= 0.707) then
		print("Vehicle is flipped.  Flipping right side up...")
		gyro.cframe = CFrame.new( Vector3.new(0,0,0), Vector3.new(0,1,0) )
		gyro.maxTorque = Vector3.new(tiltForce, tiltForce, tiltForce)
		wait(2)
		gyro.maxTorque = Vector3.new(0,0,0)
	end
	wait(8)
end
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.


s = script.Parent.Parent.Parent.Sound.Sound
s2 = script.Parent.Parent.Parent.Sound.Sound2
slowness = 0.006
script.Parent.Parent.Amp.Value = true
while true do
pitch = s.Pitch
 
if s.Pitch <= (script.MaxPitch.Value+0.01) then
s.Pitch = (s.Pitch + slowness)
s2.Pitch = s.Pitch*(12/10)
slowness = 0.045-(script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed*3.45/((script.MaxPitch.Value*25)+55))
else
wait(210)
end

if s.Pitch <= 0 then
s.Pitch = s.Pitch + slowness
s2.Pitch = s.Pitch*(12/10)

else
end
wait()
end
--F.updateSound = function(Sound, Pitch, Volume)
--	if Sound then
--		if Pitch then
--			Sound.Pitch = Pitch
--		end
--		if Volume then
--			Sound.Volume = Volume
--		end
--	end
--end



F.updateWindows = function(Window, Toggle)
	if script.Parent.Parent.Windows:findFirstChild(Window) then
		script.Parent.Parent.Windows:findFirstChild(Window).Value = Toggle
	end	
end

F.volumedown = function(VolDown)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume - 1
end

F.volumeup = function(VolUp)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + 1
end

F.fm = function(ok)
	carSeat.Parent.Body.MP.Sound:Stop()
	carSeat.Stations.mood.Value = ok
end

F.updateSong = function(id)
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
	wait()
	carSeat.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..id
	wait()
	carSeat.Parent.Body.MP.Sound:Play()
end

F.pauseSong = function()
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
end

F.updateVolume = function(Vol)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + Vol/5
end

F.updateValue = function(Val, Value)
	if Val then
		Val.Value = Value
	end
end

F.Sport = function()
	carSeat.Mode.Value = "Sport"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 2.2
	carSeat.EcoIdle.Value = 2
end

F.Comfort = function()
	carSeat.Mode.Value = "Comfort"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 2.8
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 2.8
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 2.8
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 2.8
	carSeat.EcoIdle.Value = 1
end

F.Dynamic = function()
	carSeat.Mode.Value = "Dynamic"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 1.8
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 1.8
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 1.8
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 1.8
	carSeat.EcoIdle.Value = 3
end

script.Parent.OnServerEvent:connect(function(Player, Func, ...)
	if F[Func] then
		F[Func](...)
	end
end)
--DO NOT DELETE, THIS WILL BREAK THE GUN



function Stick(x, y)
	local W = Instance.new("Weld")
	W.Part0 = x
	W.Part1 = y
	local CJ = CFrame.new(x.Position)
	local C0 = x.CFrame:inverse()*CJ
	local C1 = y.CFrame:inverse()*CJ
	W.C0 = C0
	W.C1 = C1
	W.Parent = x
end

function Get(A)
	if A.ClassName == ("Part") then
		Stick(script.Parent.Handle, A)
		A.Anchored = false
	else
		local C = A:GetChildren()
		for i=1, #C do
		Get(C[i])
		end
	end
end

function Finale()
	Get(script.Parent)
end

script.Parent.Equipped:connect(Finale)
script.Parent.Unequipped:connect(Finale)
Finale()
-- Local private variables and constants


local ZERO_VECTOR2 = Vector2.new(0,0)

local tweenAcceleration = math.rad(220)		--Radians/Second^2
local tweenSpeed = math.rad(0)				--Radians/Second
local tweenMaxSpeed = math.rad(250)			--Radians/Second
local TIME_BEFORE_AUTO_ROTATE = 2.0 		--Seconds, used when auto-aligning camera with vehicles

local INITIAL_CAMERA_ANGLE = CFrame.fromOrientation(math.rad(-15), 0, 0)
--[[
	WeaponRuntimeData 
	
	Description: WeaponRuntimeData is wraps around the tool to turn it into a weapon for all other scripts to access on the weapon.
	It contains the current ammo of a weapon, recoil simulation data, and spread simulation data. Also some helpful methods to quickly
	determine if a weapon has ammo or not.
]]



local WeaponRuntimeData = {}
WeaponRuntimeData.__index = WeaponRuntimeData
--[[Weight and CG]]


	Tune.Weight			= 3439		-- Total weight (in pounds, under Earth's gravity)
	Tune.WeightBSize	= {			-- Size of weight brick, dimensions of your car in inches divided by 10
	 --[[Width]]		7.03	,
	 --[[Height]]		5.35	,
	 --[[Length]]		18.11	}
	Tune.WeightDist		= 55		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	
	Tune.AxleSize		= 1.5		-- Size of structural members (larger = MORE STABLE / carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members

	Tune.CustomSuspensionDensity	= 0	-- Density of suspension joints, only applies to custom suspension
--



local dualWorld = require(game.ReplicatedStorage.DualWorlds).new(localPlayer.Character, doorA, doorB, Enum.NormalId.Front, localPlayer.PlayerGui)

dualWorld.PortalA:AddToWorld(dualWorld.PortalB:ClipModel(world:Clone()))
dualWorld.PortalB:AddToWorld(dualWorld.PortalA:ClipModel(world:Clone()))
--removedLength = 8


function onTouched(hit)
	if hit.Parent == nil then return end
	humanoid = hit.Parent:findFirstChild("Humanoid")
	if(ball.Name=="Icicle") then
		-- make a splat
		for i=1,3 do
			local s = Instance.new("Part")
			s.Name = "Shard"
			s.Shape = 1 -- block
			s.formFactor = 2 -- plate
			s.Size = Vector3.new(1,.4,1)
			s.BrickColor = BrickColor.new(blues[math.random(#blues)])
			s.Material = Enum.Material.Ice
			local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
			s.Velocity = 50 * v
			s.CFrame = CFrame.new(ball.Position + v, v)
			local new_script = script:clone()
			new_script.Disabled = false
			new_script.Parent = s
			s.Parent = game.Workspace

			local tag = ball:findFirstChild("creator")
			if tag~= nil then
				local new_tag = tag:clone()
				new_tag.Parent = s
			end

			debris:AddItem(s, 2)  ---NICK I THINK THIS IS IT

			if humanoid ~= nil then
				tagHumanoid(humanoid)
				humanoid:TakeDamage(damage)
				wait(2)
				untagHumanoid(humanoid)
			end

			connection:disconnect()
			ball.Parent = nil
		end

	else
		if humanoid ~= nil then
				tagHumanoid(humanoid)
				humanoid:TakeDamage(10)
				wait(2)
				untagHumanoid(humanoid)
				ball.Parent = nil
		end
		--removedLength = 2
		connection:disconnect()
	end
	
end

function tagHumanoid(humanoid)
	-- todo: make tag expire
	local tag = ball:findFirstChild("creator")
	if tag ~= nil then
		local new_tag = tag:clone()
		new_tag.Parent = humanoid
	end
end


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

connection = ball.Touched:connect(onTouched)

wait(8)