Pinkstack/roblox-luau-corpus-text huggingface dataset:
--///////////////// Internal-Use Methods
--//////////////////////////////////////
--DO NOT REMOVE THIS. Chat must be filtered or your game will face
--moderation.


function methods:InternalApplyRobloxFilter(speakerName, message, toSpeakerName) --// USES FFLAG
	if (RunService:IsServer() and not RunService:IsStudio()) then
		local fromSpeaker = self:GetSpeaker(speakerName)
		local toSpeaker = toSpeakerName and self:GetSpeaker(toSpeakerName)

		if fromSpeaker == nil then
			return nil
		end

		local fromPlayerObj = fromSpeaker:GetPlayer()
		local toPlayerObj = toSpeaker and toSpeaker:GetPlayer()

		if fromPlayerObj == nil then
			return message
		end

		local filterStartTime = tick()
		local filterRetries = 0
		while true do
			local success, message = pcall(function()
				if toPlayerObj then
					return Chat:FilterStringAsync(message, fromPlayerObj, toPlayerObj)
				else
					return Chat:FilterStringForBroadcast(message, fromPlayerObj)
				end
			end)
			if success then
				return message
			else
				warn("Error filtering message:", message)
			end
			filterRetries = filterRetries + 1
			if filterRetries > MAX_FILTER_RETRIES or (tick() - filterStartTime) > MAX_FILTER_DURATION then
				self:InternalNotifyFilterIssue()
				return nil
			end
			local backoffInterval = FILTER_BACKOFF_INTERVALS[math.min(#FILTER_BACKOFF_INTERVALS, filterRetries)]
			-- backoffWait = backoffInterval +/- (0 -> backoffInterval)
			local backoffWait = backoffInterval + ((math.random()*2 - 1) * backoffInterval)
			wait(backoffWait)
		end
	else
		--// Simulate filtering latency.
		--// There is only latency the first time the message is filtered, all following calls will be instant.
		if not StudioMessageFilteredCache[message] then
			StudioMessageFilteredCache[message] = true
			wait(0.2)
		end
		return message
	end

	return nil
end
------------------------------------------------------------------------
-- converts an integer to a "floating point byte", represented as
-- (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if
-- eeeee != 0 and (xxx) otherwise.
------------------------------------------------------------------------


function luaY:int2fb(x)
  local e = 0  -- exponent
  while x >= 16 do
    x = math.floor((x + 1) / 2)
    e = e + 1
  end
  if x < 8 then
    return x
  else
    return ((e + 1) * 8) + (x - 8)
  end
end
--//Handler//--


Button.MouseButton1Click:Connect(function()
	if CurrentAnimation.AnimationId ~= "rbxassetid://"..ID.Value then
		CurrentAnimation.AnimationId = "rbxassetid://"..ID.Value
				
		Action = Humanoid:LoadAnimation(CurrentAnimation)
		Action:Play()
	elseif CurrentAnimation.AnimationId == "rbxassetid://"..ID.Value then
		if Action then
			Action:Stop()
			
			CurrentAnimation.AnimationId = ""
			
		end
	end
end)
--local HUB = script.Parent.HUB
--local limitButton = HUB.Limiter



local carSeat = script.Parent.Car.Value
local mouse = game.Players.LocalPlayer:GetMouse()
carSeat.Values2:WaitForChild("DTR")
carSeat.Values2:WaitForChild("Lights")
mouse.KeyDown:connect(function (key)
    key = string.lower(key)
--Avxnturador @ //INSPARE


local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("DS_Sounds")
local lastGear = 0
local Rev1 = 1500
local Rev2 = 2300
local Rev3 = 3700
local Rev4 = 5000

wait(0.5)

script:WaitForChild("DS1")
script:WaitForChild("DS2")
script:WaitForChild("DS3")
script:WaitForChild("DS4")

for i,v in pairs(car.DriveSeat:GetChildren()) do
	for _,a in pairs(script:GetChildren()) do
		if v.Name==a.Name then v:Stop() wait() v:Destroy() end
	end
end

handler:FireServer("newSound","DS1",car.DriveSeat,script.DS1.SoundId,1,script.DS1.Volume,false)
handler:FireServer("newSound","DS2",car.DriveSeat,script.DS2.SoundId,1,script.DS2.Volume,false)
handler:FireServer("newSound","DS3",car.DriveSeat,script.DS3.SoundId,1,script.DS3.Volume,false)
handler:FireServer("newSound","DS4",car.DriveSeat,script.DS4.SoundId,1,script.DS4.Volume,false)

car.DriveSeat:WaitForChild("DS1")
car.DriveSeat:WaitForChild("DS2")
car.DriveSeat:WaitForChild("DS3")
car.DriveSeat:WaitForChild("DS4")


script.Parent.Values.Gear.Changed:connect(function()
	if lastGear>script.Parent.Values.Gear.Value then
		if ((script.Parent.Values.RPM.Value>=Rev1) and (script.Parent.Values.RPM.Value<Rev2)) then
			if FE then handler:FireServer("playSound","DS1") else car.DriveSeat.DS1:Play() end
		elseif ((script.Parent.Values.RPM.Value>=Rev2) and (script.Parent.Values.RPM.Value<Rev3)) then
			if FE then handler:FireServer("playSound","DS2") else car.DriveSeat.DS2:Play() end
		elseif ((script.Parent.Values.RPM.Value>=Rev3) and (script.Parent.Values.RPM.Value<Rev4)) then
			if FE then handler:FireServer("playSound","DS3") else car.DriveSeat.DS3:Play() end
		elseif (script.Parent.Values.RPM.Value>=Rev4) then
			if FE then handler:FireServer("playSound","DS4") else car.DriveSeat.DS4:Play() end
		end
	end
	lastGear = script.Parent.Values.Gear.Value
end)
--[[Susupension]]


	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS
	
	--Front Suspension
	Tune.FSusStiffness	= 22000		-- Spring Force
	Tune.FSusDamping	= 50		-- Spring Dampening
	Tune.FAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 1.9		-- Resting Suspension length (in studs)
	Tune.FPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 75		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusStiffness	= 22000		-- Spring Force
	Tune.RSusDamping	= 50		-- Spring Dampening
	Tune.RAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)
	
	Tune.RSusLength		= 2.1		-- Resting Suspension length (in studs)
	Tune.RPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
	
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics (PGS ONLY)
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Red"		-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 8				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[Rurka]


pala1 = script.Parent.Parent.Part1
legansio = true

pala2 = script.Parent.Parent.Part2
legansio = true

pala3 = script.Parent.Parent.Part3
legansio = true

pala4 = script.Parent.Parent.Part4
legansio = true

pala5 = script.Parent.Parent.Part5
legansio = true

pala6 = script.Parent.Parent.Part6
legansio = true

pala7 = script.Parent.Parent.Part7
legansio = true
--- Creates an alias command


function Util.MakeAliasCommand(name, commandString)
	return {
		Name = name,
		Aliases = {},
		Description = commandString,
		Group = "UserAlias",
		Args = {
			{
				Type = "string",
				Name = "Argument 1",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 2",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 3",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 4",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 5",
				Description = "",
				Default = ""
			}
		},
		Run = function(context, ...)
			local args = {...}
			local commands = Util.SplitStringSimple(commandString, "&&")

			for i, command in ipairs(commands) do
				local output = context.Dispatcher:EvaluateAndRun(
					Util.RunEmbeddedCommands(
						context.Dispatcher,
						Util.SubstituteArgs(command, args)
					)
				)
				if i == #commands then
					return output -- return last command's output
				else
					context:Reply(output)
				end
			end

			return ""
		end
	}
end
---------------------------------------------------------------------------------------------------------------------------
-- Functions
---------------------------------------------------------------------------------------------------------------------------



local function Weld(X, Y)
	local CJ = CFrame.new(X.Position)
	local C0 = X.CFrame:inverse()*CJ
	local C1 = Y.CFrame:inverse()*CJ
	
	local W = Create("Weld"){
		Name = "Weld",
		Parent = X,
		Part0 = X,
		Part1 = Y,
		C0 = C0,
		C1 = C1
	}
end

local function WeldObjects(parent)
	for i, obj in pairs(parent:GetChildren()) do
		if obj:IsA("Part") or obj:IsA("UnionOperation") then
			Weld(Handle, obj)
			obj.Anchored = false
			-- print("[Weld] Objects have been welded!")
		end
	end
end

Tool.Equipped:connect(function()
	WeldObjects(Tool)
end)

Tool.Unequipped:connect(function()
	WeldObjects(Tool)
end)
--[=[
	Fires a signal at the clients within the `players` table. This is
	useful when signals need to fire for a specific set of players.

	For more complex firing, see `FireFilter`.

	:::note Outbound Middleware
	All arguments pass through any outbound middleware (if any)
	before being sent to the clients.
	:::

	```lua
	local players = {somePlayer1, somePlayer2, somePlayer3}
	remoteSignal:FireFor(players, "Hello, players!")
	```
]=]


function RemoteSignal:FireFor(players: { Player }, ...: any)
	for _, player in ipairs(players) do
		self._re:FireClient(player, self:_processOutboundMiddleware(nil, ...))
	end
end
--[[
GAVturet	- основной модуль
GAVAttack	- скрипт цепляемый к пушке 				Fire	
bullet		- скрипт отвечающий за полёт снарядов	Rocket	-- за повреждение 

]]

--

local Players = game:GetService("Players") -- берём ссылку на список игроков

local module = {}
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 773		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 1100		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 8250		--		Use sliders to manipulate values
	Tune.Redline		= 8750		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5250
	Tune.PeakSharpness	= 5.8
	Tune.CurveMult		= 0.294 
	
	--Incline Compensation
	Tune.InclineComp	= 1.5		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 400		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 300		-- RPM decay when clutch is off
	Tune.RevBounce		= 450		-- RPM kickback from redline
	Tune.IdleThrottle	= 0			-- Percent throttle at idle
	Tune.ClutchTol		= 450		-- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
--[[
	This file is to provide a simple place to update values that
	 this error reporter needs to be able to function properly.

	These values are only read in as constants. Changing them while the game is running
	 will not update the behaviors of the reporters.
]]




return {
	-- Game metadata
	GAME_VERSION = "0.0.1",

	-- Google Analytics values
	REPORT_TO_GOOGLE_ANALYTICS = true,
	GOOGLE_ANALYTICS_TRACKING_ID = "UA-149120298-1", ---TODO: PLS REMOVE BEFORE RELEASE
	PRINT_SUCCESSFUL_GOOGLE_ANALYTICS = true,

	-- PlayFab values
	REPORT_TO_PLAYFAB = false,
	PRINT_SUCCESSFUL_PLAYFAB = true,

	-- General behaviors
	DEBUG_HTTP = false,
	DEBUG_REPORTER = false,
}
------------------------------------------------------------------------
-- verifies token conditions are met or else throw error
------------------------------------------------------------------------


function luaY:check_match(ls, what, who, where)
  if not self:testnext(ls, what) then
    if where == ls.linenumber then
      self:error_expected(ls, what)
    else
      luaX:syntaxerror(ls, string.format(
        self.LUA_QS.." expected (to close "..self.LUA_QS.." at line %d)",
        luaX:token2str(ls, what), luaX:token2str(ls, who), where))
    end
  end
end
--//SS6 PLUGIN; SPLASH//--


  --//INSPARE 2017//--

local ai = script.Parent.Main_Frame.A.Frame.ImageLabel
local bi = script.Parent.Main_Frame.B.Frame.ImageLabel
local ci = script.Parent.Main_Frame.C.Frame.ImageLabel
local di = script.Parent.Main_Frame.D.Frame.ImageLabel
local ei = script.Parent.Main_Frame.E.Frame.ImageLabel

ai.Size = UDim2.new(18,0,9,0)
bi.Size = UDim2.new(18,0,9,0)
ci.Size = UDim2.new(18,0,9,0)
di.Size = UDim2.new(18,0,9,0)
ei.Size = UDim2.new(18,0,9,0)

wait(.2)
script.Parent.SplashFade.OC:Play()
while true do
	for i=1,2 do
		for i=1,5 do
			ai.Position = ai.Position - UDim2.new(3,0,0,0)
			bi.Position = bi.Position - UDim2.new(3,0,0,0)
			ci.Position = ci.Position - UDim2.new(3,0,0,0)
			di.Position = di.Position - UDim2.new(3,0,0,0)
			ei.Position = ei.Position - UDim2.new(3,0,0,0)
			wait(.1)
		end
		ai.Position = ai.Position + UDim2.new(15,0,-3,0)
		bi.Position = bi.Position + UDim2.new(15,0,-3,0)
		ci.Position = ci.Position + UDim2.new(15,0,-3,0)
		di.Position = di.Position + UDim2.new(15,0,-3,0)
		ei.Position = ei.Position + UDim2.new(15,0,-3,0)
		wait(.1)
	end
	ai.Position = ai.Position + UDim2.new(0,0,6,0)
	bi.Position = bi.Position + UDim2.new(0,0,6,0)
	ci.Position = ci.Position + UDim2.new(0,0,6,0)
	di.Position = di.Position + UDim2.new(0,0,6,0)
	ei.Position = ei.Position + UDim2.new(0,0,6,0)
	wait(.1)
end
-- ScreenSpace -> WorldSpace. Taking a screen height, and a depth to put an object 
-- at, and returning a size of how big that object has to be to appear that size
-- at that depth.


function ScreenSpace.ScreenToWorldByHeightDepth(x, y, screenHeight, depth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
	--
	local worldHeight = -(screenHeight/sy) * 2 * hfactor * depth
	--
	local xf, yf = x/sx*2 - 1, y/sy*2 - 1
	local xpos = xf * -wfactor * depth
	local ypos = yf *  hfactor * depth
	--
	return Vector3.new(xpos, ypos, depth), worldHeight
end
--[[Steering]]


Tune.SteerInner		= 45.2		-- Inner wheel steering angle (in degrees)
Tune.SteerOuter		= 45.2		-- Outer wheel steering angle (in degrees)
Tune.SteerSpeed		= .18		-- Steering increment per tick (in degrees)
Tune.ReturnSpeed	= .2		-- Steering increment per tick (in degrees)
Tune.SteerDecay		= 330		-- Speed of gradient cutoff (in SPS)
Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
Tune.MSteerExp		= 1			-- Mouse steering exponential degree
--[[
ButtonFire.ProximityPrompt.Enabled = true
ButtonFire.ProximityPrompt.MaxActivationDistance = 5
ButtonFire.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("fire",1)
	ButtonFire.Click:Play()
end)
]]



ButtonCancel.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("signal",0)
	ButtonCancel.Click:Play()
end)

ButtonTest.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("test")
end)

ButtonTest.ProximityPrompt.TriggerEnded:Connect(function()
	Events:Fire("stoptest")
end)
--//=================================\\
--|| 		   EFFECTS
--\\=================================//



function SpawnPuddle(POSITION,IGNR,GOO)
	local HIT,POS,NOR = Raycast(POSITION, CFrame.new(POSITION,POSITION-Vector3.new(0,1,0)).lookVector, 12, IGNR)
	if HIT then
		coroutine.resume(coroutine.create(function()
			local GOREPART = CreatePart(3, Effects, "SmoothPlastic", 0, 1, "White", "Gore", VT(3,0,3), true)
			local SURFACE = script.Puddle:Clone()
			SURFACE.Parent = GOREPART
			if GOO == true then
				SURFACE.Image.ImageColor3 = C3(1,1,1)
			end
			GOREPART.CFrame = CFrame.new(POS,POS+NOR)*CFrame.Angles(math.rad(-90),math.rad(math.random(0,360)),0)
			for i = 1, math.random(25,65) do
				Swait()
				GOREPART.Size = GOREPART.Size + Vector3.new(0.1,0,0.1)
			end
			wait(math.random(10,25)/50)
			for i = 1, 25 do
				Swait()
				SURFACE.Image.ImageTransparency = SURFACE.Image.ImageTransparency + 1/25
			end
			GOREPART:Remove()
		end))
	end
end
-- RANK, RANK NAMES & SPECIFIC USERS


Ranks = {
	{5,	"Hail Me",		};
	{4,	"HeadAdmin",	{"",0},	};
	{3,	"Admin",		{"",0},	};
	{2,	"Mod",			{"",0},	};
	{1,	"VIP",			{"",0},	};
	{0,	"NonAdmin",		};
};
--// Aim|Zoom|Sensitivity Customization


	ZoomSpeed = 0.1; -- The lower the number the slower and smoother the tween
	AimZoom = 50; -- Default zoom
	AimSpeed = 0.25;
	UnaimSpeed = 0.05;
	CycleAimZoom = 4; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
--[=[
	@param signal Signal | RBXScriptSignal
	@param callbackFn UpdateCallbackFn
	@return Connection | RBXScriptConnection

	Bind the `Update` method to a signal. For instance, this can be used
	to connect to `RunService.Heartbeat`.

	All connections are cleaned up when the shake instance is stopped
	or destroyed.

	```lua
	local function SomeShake(pos: Vector3, rot: Vector3, completed: boolean)
		-- Shake
	end

	shake:OnSignal(RunService.Heartbeat, SomeShake)
	```
]=]


function Shake:OnSignal(signal, callbackFn: UpdateCallbackFn)
	return self._trove:Connect(signal, function()
		callbackFn(self:Update())
	end)
end
---------------------------
--[[
	--Main anchor point is the DriveSeat <car.DriveSeat>	
	
	Usage:
		MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld"  **Applies to Motor welds only
		ModelWeld(Model,MainPart)
	Example:
		MakeWeld(car.DriveSeat,misc.PassengerSeat)
		MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
		ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here


MakeWeld(misc.Popups.left.lHinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Popups.left.Parts,misc.Popups.left.lHinge)
MakeWeld(misc.Popups.right.rHinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Popups.right.Parts,misc.Popups.right.rHinge)
MakeWeld(misc.Trunk.Hinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Trunk.Parts,misc.Trunk.Hinge)
MakeWeld(misc.Hood.Hinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Hood.Parts,misc.Hood.Hinge)
MakeWeld(car.Misc.Wheel.A,car.DriveSeat,"Motor",.5).Name="W"
ModelWeld(car.Misc.Wheel.Parts,car.Misc.Wheel.A)
--------LEFT DOOR 1--------


game.Workspace.doorleft.l73.BrickColor = BrickColor.new(135)

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

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(102)
--Internal functions


function DataStore:Debug(...)
	if self.debug then
		print("[DataStore2.Debug]", ...)
	end
end

function DataStore:_GetRaw()
	if self.getRawPromise then
		return self.getRawPromise
	end

	self.getRawPromise = self.savingMethod:Get():andThen(function(value)
		self.value = value
		self:Debug("value received")
		self.haveValue = true
		self.getting = false
	end):catch(function(reason)
		self.getting = false
		self.getRawPromise = nil
		return Promise.reject(reason)
	end)

	return self.getRawPromise
end

function DataStore:_Update(dontCallOnUpdate)
	if not dontCallOnUpdate then
		for _, callback in ipairs(self.callbacks) do
			callback(self.value, self)
		end
	end

	self.haveValue = true
	self.valueUpdated = true
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 = "Handle"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(2, 1, 2) 
		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.35, 0)
		h.AttachmentRight = Vector3.new(1, -0, 0)
		h.AttachmentUp = Vector3.new(0, 0.995, -0.0995)
		h.AttachmentForward = Vector3.new(0, -0.0995, -0.995)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--[[Weld functions]]



	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()
	
	function MakeWeld(x,y,type,s) 
		if type==nil then type="Weld" end
		local W=Instance.new(type,JS) 
		W.Part0=x W.Part1=y 
		W.C0=x.CFrame:inverse()*x.CFrame 
		W.C1=y.CFrame:inverse()*x.CFrame 
		if type=="Motor" and s~=nil then 
			W.MaxVelocity=s 
		end 
		return W	
	end
	
	function ModelWeld(a,b) 
		if a:IsA("BasePart") and 
			a.Parent.Name ~= ("Lights") and
			a.Parent.Name ~= ("Chasis") and
			a.Parent.Name ~= ("RotLight") and
			a.Parent.Name ~= ("Door") then 
			MakeWeld(b,a,"Weld")
			for i,v in pairs(a:GetChildren()) do 
				if v ~= nil and v:IsA("BasePart") then
					ModelWeld(v,b) 
				end
			end
		elseif a:IsA("Model") then 
			for i,v in pairs(a:GetChildren()) do 
				ModelWeld(v,b) 
			end 
		end 
	end
	
	function UnAnchor(a) 
		if a:IsA("BasePart") then a.Anchored=false  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end 
	end