Pinkstack/roblox-luau-corpus-text huggingface dataset:
--local ClickerModule = require(343254562)
--local clickEvent = ClickerModule.RemoteEvent


local interactiveParts = {}
local activationDistance = 12
local flushing = false
local water = script.Parent.Parent.Water
local sound = script.Parent.Parent.ToiletBowl.Sound
sound.TimePosition = 0.05
sound:Play()
wait(0.67)

			for i, v in pairs(script.Parent.Parent:GetChildren()) do
				if v.Name == "WaterSwirl" then
					v.ParticleEmitter.Transparency = NumberSequence.new(0.9)
					v.ParticleEmitter.Rate = 500
				end
end
			
			for i = 1, 10 do
				water.CFrame = water.CFrame * CFrame.new(0, 0.003, 0)
				wait()
			end
			wait(7)
			
			for i = 1, 130 do
				water.Mesh.Scale = water.Mesh.Scale + Vector3.new(-0.003, 0, -0.003)
				water.CFrame = water.CFrame * CFrame.new(0, -0.003, 0)
				wait()
			end
			
			wait(0.2)
			
			for i, v in pairs(script.Parent.Parent:GetChildren()) do
				if v.Name == "WaterSwirl" then
					v.ParticleEmitter.Rate = 0
					end
			end
wait()
			
			
			if script.Parent.Parent.ToiletUsed.Value == true then
				water.BrickColor = BrickColor.new("Pastel yellow")
			end
			
			wait(0)
			
			for i = 1, 10 do
				for ii, v in pairs(script.Parent.Parent:GetChildren()) do
					if v.Name == "WaterSwirl" then
						v.ParticleEmitter.Transparency = NumberSequence.new(0.9 + (0.015 * i))
						if i == 10 then
							v.ParticleEmitter.Rate = 0
						end
end
				end
				wait(0.2)
			end
			
			script.Parent.Parent.ToiletUsed.Value = false
			water.BrickColor = BrickColor.new("Fog")
			
			for i = 1, 370 do
				water.Mesh.Scale = water.Mesh.Scale + Vector3.new(0.001, 0, 0.001)
				water.CFrame = water.CFrame * CFrame.new(0, 0.001, 0)
				wait()
			end
			water.CFrame = script.Parent.Parent.WaterResetPos.CFrame
			water.Mesh.Scale = Vector3.new(1,0,1)
			flushing = false
			script.Disabled = true
--Ban players across different servers


local banConnection = ms:SubscribeAsync(banTopic, function(message)
	local targetId = message.Data[1]
	local banMessage = message.Data[2]
	
	for i, plr in pairs(game.Players:GetPlayers()) do
		if plr.UserId == targetId then
			plr:Kick(banMessage)
		end
	end
end)
--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")


		local anim = animTable[animName][idx].anim

		-- load it to the humanoid; get AnimationTrack
		toolAnimTrack = humanoid:LoadAnimation(anim)
		 
		-- play the animation
		toolAnimTrack:Play(transitionTime)
		toolAnimName = animName

		currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
	end
end

function stopToolAnimations()
	local oldAnim = toolAnimName
	if currentToolAnimKeyframeHandler then
		currentToolAnimKeyframeHandler:disconnect()
	end
	toolAnimName = ""
	if toolAnimTrack then
		toolAnimTrack:Stop()
		toolAnimTrack:Destroy()
		toolAnimTrack = nil
	end
	return oldAnim
end
--[[Brakes]]


	Tune.ABSEnabled		= true		-- Implements ABS
	Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS) 

	Tune.FBrakeForce	= 2100		-- Front brake force
	Tune.RBrakeForce	= 2000		-- Rear brake force
	Tune.PBrakeForce	= 5000		-- Handbrake force
	
	Tune.FLgcyBForce	= 15000		-- Front brake force [PGS OFF]
	Tune.RLgcyBForce	= 10000		-- Rear brake force [PGS OFF]
	Tune.LgcyPBForce	= 25000		-- Handbrake force [PGS OFF]
--[=[
	@within RemoteSignal
	@interface Connection
	.Disconnect () -> nil
	.Connected boolean
]=]



function RemoteSignal.new(
	parent: Instance,
	name: string,
	inboundMiddleware: Types.ServerMiddleware?,
	outboundMiddleware: Types.ServerMiddleware?
)
	local self = setmetatable({}, RemoteSignal)
	self._re = Instance.new("RemoteEvent")
	self._re.Name = name
	self._re.Parent = parent
	if outboundMiddleware and #outboundMiddleware > 0 then
		self._hasOutbound = true
		self._outbound = outboundMiddleware
	else
		self._hasOutbound = false
	end
	if inboundMiddleware and #inboundMiddleware > 0 then
		self._directConnect = false
		self._signal = Signal.new()
		self._re.OnServerEvent:Connect(function(player, ...)
			local args = table.pack(...)
			for _, middlewareFunc in ipairs(inboundMiddleware) do
				local middlewareResult = table.pack(middlewareFunc(player, args))
				if not middlewareResult[1] then
					return
				end
				args.n = #args
			end
			self._signal:Fire(player, table.unpack(args, 1, args.n))
		end)
	else
		self._directConnect = true
	end
	return self
end
--removedLength = 8


function onTouched(hit)
	if hit.Parent == nil or hit.Name == "Bullet" then return end
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	if(ball.Name=="Bullet") 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(.4,.4,.4)
			s.BrickColor = BrickColor.new(blacks[math.random(#blacks)])
			s.Material = Enum.Material.Plastic
			local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
			s.Velocity = 125 * 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)  

			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)
-- (Hat Giver Script - Loaded.)



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "WerewolfCrown"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(0,-0.25,0) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, -0.05, 0)
		h.AttachmentRight = Vector3.new(1, 0, 0)
		h.AttachmentUp = Vector3.new(0, 1, 0)
		h.AttachmentForward = Vector3.new(-0, -0, -1)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--- haha pro scripting go brrr (not copy and pasted)



local fl = Instance.new("Motor", script.Parent.Parent.Misc.FL.SS) --doors
local fr = Instance.new("Motor", script.Parent.Parent.Misc.FR.SS)
local rl = Instance.new("Motor", script.Parent.Parent.Misc.RL.SS)
local rr = Instance.new("Motor", script.Parent.Parent.Misc.RR.SS)

fl.MaxVelocity = 0.03
fl.Part0 = script.Parent.FL
fl.Part1 = fl.Parent

fr.MaxVelocity = 0.03
fr.Part0 = script.Parent.FR
fr.Part1 = fr.Parent

rl.MaxVelocity = 0.03
rl.Part0 = script.Parent.RL
rl.Part1 = rl.Parent

rr.MaxVelocity = 0.03
rr.Part0 = script.Parent.RR
rr.Part1 = rr.Parent
--[[
	Instead of doing lots of task.spawns for running on seperate threads	
	use this which is more performant & is better for memory management.
	
	`FreeThread` idea from derived from `Signal`. I want to point how the way
	it operates is the same but is improved.
	
	:::note
	1. Garbage collection is all about references.
	2. Only use this module if you know the enviroments wont always yield (this can severly slow down code)
	:::
]]



local FreeThread: thread?

local function AquireFreeThreadAndCall(fn: (...unknown) -> (), ...)
	local aquiredThread = FreeThread
	FreeThread = nil
	fn(...)
	FreeThread = aquiredThread
end

local function CreateResumptionForFreeThread()
	while true do
		AquireFreeThreadAndCall(coroutine.yield()) 
	end
end

local function Call<T...>(func: (T...) -> (), ...: T...)
	assert(type(func) == 'function', `Function expected, got {typeof(func)}`)

	if not FreeThread then
		FreeThread = task.spawn(CreateResumptionForFreeThread)
	end

	task.spawn(FreeThread :: thread, func, ...)
end

local function All(tbl: {(...unknown) -> ()}, ...: unknown)
	for _, fn in tbl do
		Call(fn, ...)
	end
end

local function List(tbl: {}, func: (key: any, value: any) -> ())
	for k, v in tbl do
		Call(func, k, v)
	end
end

local function Empty()
	FreeThread = nil
end

local class = {
	Empty = Empty,
	Call = Call,
	List = List,
	All = All,
}

return class
--[[



]]



local ReplicatedStorage = game:GetService("ReplicatedStorage")

local AvatarEditor = ReplicatedStorage.AvatarEditor
local Signal = require(AvatarEditor.Shared.Util.Signal)
local Maid = require(AvatarEditor.Shared.Util.Maid)
local Settings = require(AvatarEditor.Shared.Settings)

local themesFolder = AvatarEditor.Themes

local currentTheme = require(themesFolder[Settings.DEFAULT_THEME])
local currentName = Settings.DEFAULT_THEME


local module = {}
module.Changed = Signal.new()


function module:GetColor(style)
	return currentTheme[style]
end


function module:Set(themeName)
	if currentName == themeName then
		return
	end
	
	local themeModule = themesFolder:FindFirstChild(themeName)
	if themeModule then
		currentTheme = nil
		currentTheme = require(themeModule)
		currentName = themeModule.Name
		
		module.Changed:Fire(themeName)
	else
		warn(themeName, "not a valid theme")
	end
end


function module:Bind(frame, property, style)
	local connections = Maid.new()
	--maid:GiveTask(connections)
	--local ancestorChangedConnection, themeChangedConnection
	local function update()
		frame[property] = self:GetColor(style)
	end
	update()
	connections:GiveTask(module.Changed:Connect(update))
	connections:GiveTask(frame.AncestryChanged:Connect(function(_, parent)
		if not parent then
			connections:DoCleaning()
			update = nil
		end
	end))
	return connections
end


function module:GetAll()
	local themes = {}
	local themeModules = themesFolder:GetChildren()
	table.sort(themeModules, function(a, b)
		return a.Name < b.Name
	end)
	for i, v in ipairs(themeModules) do
		table.insert(themes, v.Name)
	end
	return themes
end


return module
---Size standards


local DEFAULT_ICON_SIZE=Vector2.new(18,18)

local TextService = game:GetService("TextService")

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
	Players.ChildAdded:wait()
	LocalPlayer = Players.LocalPlayer
end

local clientChatModules = script.Parent.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))

local module = {}
local methods = {}
methods.__index = methods

function methods:GetStringTextBounds(text, font, textSize, sizeBounds)
	sizeBounds = sizeBounds or Vector2.new(10000, 10000)
	return TextService:GetTextSize(text, textSize, font, sizeBounds)
end
--[[Transmission]]


	Tune.TransModes		= {"Auto"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 3.7				-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3			,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		2.6			,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		1.8			,
		--[[ 3 ]]		1.3			,
		--[[ 4 ]]		1			,
		--[[ 5 ]]		.8			,
		--[[ 6 ]]		.6			,				
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- MAIN CODE -- (Do not edit!)


local http = game:GetService("HttpService")

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.fdbk.Text == "" then return end
	local fb = script.Parent.Parent.fdbk.Text
	script.Parent.Parent.fdbk.Text = ""
	game:GetService("ReplicatedStorage").sendReport:FireServer(fb)
end)
-- Ritter's loose bounding sphere algorithm


function CameraUtils.getLooseBoundingSphere(parts: {BasePart})
	local points = table.create(#parts)
	for idx, part in pairs(parts) do
		points[idx] = part.Position
	end
	
	-- pick an arbitrary starting point
	local x = points[1]

	-- get y, the point furthest from x
	local y = x
	local yDist = 0

	for _, p in ipairs(points) do
		local pDist = (p - x).Magnitude

		if pDist > yDist then
			y = p
			yDist = pDist
		end
	end

	-- get z, the point furthest from y
	local z = y
	local zDist = 0

	for _, p in ipairs(points) do
		local pDist = (p - y).Magnitude

		if pDist > zDist then
			z = p
			zDist = pDist
		end
	end

	-- use (y, z) as the initial bounding sphere
	local sc = (y + z)*0.5
	local sr = (y - z).Magnitude*0.5

	-- expand sphere to fit any outlying points
	for _, p in ipairs(points) do
		local pDist = (p - sc).Magnitude

		if pDist > sr then
			-- shift to midpoint
			sc = sc + (pDist - sr)*0.5*(p - sc).Unit

			-- expand
			sr = (pDist + sr)*0.5
		end
	end

	return sc, sr
end
--[=[
	@param player Player
	@return DataStore
]=]


function PlayerDataStoreManager:GetDataStore(player)
	assert(typeof(player) == "Instance", "Bad player")
	assert(player:IsA("Player"), "Bad player")

	if self._removing[player] then
		warn("[PlayerDataStoreManager.GetDataStore] - Called GetDataStore while player is removing, cannot retrieve")
		return nil
	end

	if self._datastores[player] then
		return self._datastores[player]
	end

	return self:_createDataStore(player)
end
--[[
	Package link auto-generated by Rotriever
]]


local PackageIndex = script.Parent.Parent.Parent._Index

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

export type MaybeMockedDeep<T> = Package.MaybeMockedDeep<T> 
export type MaybeMocked<T> = Package.MaybeMocked<T> 
export type ModuleMocker = Package.ModuleMocker


return Package
-- Compare two packed tables for shallow equality.


local fmtArgs = require(script.Parent.fmtArgs)

return function(e, a)
	if e.n ~= a.n then
		local msg = "number of literals in " .. fmtArgs(e) .. " does not match number of args in " .. fmtArgs(a)
		return false, msg
	end

	for i = 1, e.n do
		if e[i] ~= a[i] then
			local msg = "expected " .. fmtArgs(e) .. ", got " .. fmtArgs(a)
			return false, msg
		end
	end
	return true
end
--[[
	
	Controls.Keyboard
	Controls.Mouse
	Controls.Gamepad
	
--]]





local Controls = {
	Keyboard = require(script:WaitForChild("Keyboard"));
	Mouse = require(script:WaitForChild("Mouse"));
	Gamepad = require(script:WaitForChild("Gamepad"));
	Mobile = require(script:WaitForChild("Mobile"));
}

return Controls
-- Handle user input began differently depending on whether a shift key is pressed


local function Input(input, gameProcessedEvent)
	while IsShiftKeyDown() do
		wait()
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 50
	end
	game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25
end
 
UserInputService.InputBegan:Connect(Input)
--> FUNCTIONS


ClickedEvent.OnServerEvent:Connect(function(Player, MousePosition)
	if not Reloading then
		Reloading = true
		Flare.Handle.Reload:Play()
		local FlareBulletClone = FlareBullet:Clone()
		FlareBulletClone.Transparency = 0
		FlareBulletClone.CanCollide = true
		FlareBulletClone.CFrame = CFrame.new(FlareBulletClone.Position, MousePosition)
		FlareBulletClone.Parent = game.Workspace
		local Force = Instance.new("BodyVelocity", FlareBulletClone)
		Force.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
		Force.Velocity = FlareBulletClone.CFrame.lookVector * BulletVelocity.Value
		local Script = FlareBulletScript:Clone()
		Script.Parent = FlareBulletClone
		BulletVelocity:Clone().Parent = FlareBulletClone
		Script.Disabled = false
		wait(ReloadTime)
		Reloading = false
	else end
end)

Flare.Equipped:Connect(function()
	Flare.Handle.Equip:Play()
end)
--Obj


local Frame

local RenderCount = {}

function RenderCount:Setup(UI)
    Frame = UI
    
    Frame.Text.FocusLost:Connect(function()
        local text = tonumber(Frame.Text.Text)
        if (text) then
            Frame.Text.Text = text
            self.Modules.Entity.EntitySettings.MaxRenderCount = text
        else 
            Frame.Text.Text = self.Modules.Entity.EntitySettings.MaxRenderCount
        end
    end)
end 

return RenderCount
--- Clear admins cache of any useless info


local function ClearGarbage()
	for playerName, playerData in pairs(adminsCache) do
		local playerIsAdmin = playerData[1]
		local playerTick = playerData[2]
		local playerIsInServer = (game.Players:FindFirstChild(playerName))
		if not playerIsInServer and playerIsAdmin and (tick() - playerData[2]) >= 300 then
			adminsCache[playerName] = nil
		end
	end
end
------------------------------------------------------------------------
-- parses general expression types, constants handled here
-- * used in subexpr()
------------------------------------------------------------------------


function luaY:simpleexp(ls, v)
  -- simpleexp -> NUMBER | STRING | NIL | TRUE | FALSE | ... |
  --              constructor | FUNCTION body | primaryexp
  local c = ls.t.token
  if c == "TK_NUMBER" then
    self:init_exp(v, "VKNUM", 0)
    v.nval = ls.t.seminfo
  elseif c == "TK_STRING" then
    self:codestring(ls, v, ls.t.seminfo)
  elseif c == "TK_NIL" then
    self:init_exp(v, "VNIL", 0)
  elseif c == "TK_TRUE" then
    self:init_exp(v, "VTRUE", 0)
  elseif c == "TK_FALSE" then
    self:init_exp(v, "VFALSE", 0)
  elseif c == "TK_DOTS" then  -- vararg
    local fs = ls.fs
    self:check_condition(ls, fs.f.is_vararg ~= 0,
                    "cannot use "..self:LUA_QL("...").." outside a vararg function");
    -- NOTE: the following substitutes for a bitop, but is value-specific
    local is_vararg = fs.f.is_vararg
    if is_vararg >= self.VARARG_NEEDSARG then
      fs.f.is_vararg = is_vararg - self.VARARG_NEEDSARG  -- don't need 'arg'
    end
    self:init_exp(v, "VVARARG", luaK:codeABC(fs, "OP_VARARG", 0, 1, 0))
  elseif c == "{" then  -- constructor
    self:constructor(ls, v)
    return
  elseif c == "TK_FUNCTION" then
    luaX:next(ls)
    self:body(ls, v, false, ls.linenumber)
    return
  else
    self:primaryexp(ls, v)
    return
  end--if c
  luaX:next(ls)
end
--Automatic Settings


Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
Tune.AutoUpThresh	= 250		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 50		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)
--// IMPORTANT!! DONT DELET


script.Car.Value=script.Parent.Parent.Parent


wait(0.2)
driveseat.ChildAdded:connect(function()
	local plr = game.Players:GetPlayerFromCharacter(driveseat.Occupant.Parent)
	script.Parent.Frame.Title.Text = plr.Name
	script.Parent.Parent=plr.PlayerGui
end)
-- (Hat Giver Script - Loaded.)



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "RedFabrege"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(2, 1, 1) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, -1.125, 0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--[=[
	Constructs a new Signal that wraps around an RBXScriptSignal.

	@param rbxScriptSignal RBXScriptSignal -- Existing RBXScriptSignal to wrap
	@return Signal

	For example:
	```lua
	local signal = Signal.Wrap(workspace.ChildAdded)
	signal:Connect(function(part) print(part.Name .. " added") end)
	Instance.new("Part").Parent = workspace
	```
]=]


function Signal.Wrap(rbxScriptSignal)
	assert(
		typeof(rbxScriptSignal) == "RBXScriptSignal",
		"Argument #1 to Signal.Wrap must be a RBXScriptSignal; got " .. typeof(rbxScriptSignal)
	)
	local signal = Signal.new()
	signal._proxyHandler = rbxScriptSignal:Connect(function(...)
		signal:Fire(...)
	end)
	return signal
end
--[[
This will make the belt work automatically in the game.
P.S. If your belt is a SPINNER, do the following:

Connect the spinner to the Title w/ a HingeConstraint, and make sure the constraint is in the belt model.
Boom you're done.

MAKE SURE THE PRIMARY PART STAYS AS THE BELTCENTER.

WHEN CHANGING THE BELTCENTER/PLATE SIZES, MAKE SURE TO CHANGE IT THRU THE PROPERTIES AND NOT THE HANDLERS, ELSEWISE YOU WILL HAVE TO SET UP THE MOTOR6Ds
ON YOUR OWN.

YOU CAN SAFELY DELETE ANY EXTRA SIDEPLATES IF YOU DON'T NEED THEM.
]]
--------LEFT DOOR --------


game.Workspace.doorleft.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)