Pinkstack/roblox-luau-corpus-text huggingface dataset:
------------------------------------------------------------------------------
--------------------[ MAIN PROGRAM ]------------------------------------------
------------------------------------------------------------------------------



function DetonateExplosive()
	local GrenadePos = Main.Position
	
	CreateShockwave(Main.Position, S.GrenadeBlastRadius)
	
	Sound:Play()
	
	local E = Instance.new("Explosion")
	E.BlastPressure = S.GrenadeBlastPressure
	E.BlastRadius = S.GrenadeBlastRadius
	E.DestroyJointRadiusPercent = (S.GrenadeRangeBasedDamage and 0 or 1)
	E.ExplosionType = S.GrenadeExplosionType
	E.Position = GrenadePos
	E.Hit:connect(function(HObj, HDist)
		if (not IsIgnored(HObj)) and HObj.Name == "Torso" then
			if S.GrenadeRangeBasedDamage then
				local ClosestPart = nil
				local ClosestDist = math.huge
				
				for _, P in pairs(HObj.Parent:GetChildren()) do
					if P:IsA("BasePart") then
						local Dist = (GrenadePos - P.Position).magnitude
						if Dist < ClosestDist then
							ClosestPart = P
							ClosestDist = Dist
						end
					end
				end
				
				local Dir = (ClosestPart.Position - GrenadePos).unit
				local H, P = AdvRayCast(GrenadePos, Dir, 999)
				local RayHitHuman = H:IsDescendantOf(HObj.Parent)
				if (S.GrenadeRayCastExplosions and RayHitHuman) or (not S.GrenadeRayCastExplosions) then
					local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
					if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
						local DistFactor = ClosestDist / S.GrenadeBlastRadius
						local DistInvert = math.max(1 - DistFactor, 0)
						local NewDamage = DistInvert * S.LethalGrenadeDamage
						
						local CreatorTag = Instance.new("ObjectValue")
						CreatorTag.Value = Plyr
						CreatorTag.Name = "creator"
						CreatorTag.Parent = HitHumanoid
						HitHumanoid:TakeDamage(NewDamage)
						MarkHit()
					end
				end
			else
				local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
				if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
					local CreatorTag = Instance.new("ObjectValue")
					CreatorTag.Value = Plyr
					CreatorTag.Name = "creator"
					CreatorTag.Parent = HitHumanoid
					MarkHit()
				end
			end
		end
	end)
	E.Parent = game.Workspace
	
	Main.Transparency = 1
	Main.Anchored = true
	Main.CanCollide = false
	
	wait(1)
	
	Connection:disconnect()
	Main:Destroy()
end

Main.Touched:connect(function(Obj)
	if IsIgnored(Obj) or Detonated then return end
	GrenadeCF = Main.CFrame
	
	local W = Instance.new("Weld")
	W.Name = "Semtex"
	W.Part0 = Main
	W.Part1 = Obj
	W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
	W.Parent = Main
	
	Connection = Main.ChildRemoved:connect(function(C)
		if C.Name == "Semtex" and (not Detonated) then
			local W = Instance.new("Weld")
			W.Name = "Semtex"
			W.Part0 = Main
			W.Part1 = Obj
			W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
			W.Parent = Main
		end
	end)
	
	if S.TimerStartOnHit then
		Detonated = true
		wait(S.DetonationTime)
		DetonateExplosive()
	end
end)

if (not S.TimerStartOnHit) then
	wait(S.DetonationTime)
	Detonated = true
	DetonateExplosive()
end
--[[INSTALL PROCESS]]--
-- Place the brick in the body group, where your radiator would be, and place the "Temperature" GUI in the plugin folder!
-- This plugin is Filtering Enabled compatible




script:WaitForChild("Celsius")
script:WaitForChild("Blown")
local car = script.Parent.Parent.Parent.Parent.Car.Value
local radiator = car.Body.Smoke
local mouse = game.Players.LocalPlayer:GetMouse()
local handler = car.EngineOverheat
local FE = workspace.FilteringEnabled
--//Controller//--


RunService.RenderStepped:Connect(function()
	TweenService:Create(
		Display,
		
		TweenInfo.new(
			0.25
		),
		
		{
			Size = UDim2.new(1 * Humanoid.Health / Humanoid.MaxHealth, 0, 1, 0)
		}
	):Play()
	
	Status.Text = math.floor(Humanoid.Health).." / "..Humanoid.MaxHealth
	
	if Humanoid.Health <= Humanoid.MaxHealth and Humanoid.Health > Humanoid.MaxHealth * 50 / 100 then
		Display.BackgroundColor3 = Color3.fromRGB(0, 170, 0)
		
	elseif Humanoid.Health <= Humanoid.MaxHealth * 50 / 100 and Humanoid.Health > Humanoid.MaxHealth * 25 / 100 then
		Display.BackgroundColor3 = Color3.fromRGB(255, 170, 0)
		
	elseif Humanoid.Health <= Humanoid.MaxHealth * 25 / 100 then
		Display.BackgroundColor3 = Color3.fromRGB(170, 0, 0)

	end
end)
-- Returns the ancestor that contains a Humanoid, if it exists


local function FindCharacterAncestor(subject)
	if subject and subject ~= game.Workspace then
		local humanoid = subject:FindFirstChild('Humanoid')
		if humanoid then
			return subject, humanoid
		else
			return FindCharacterAncestor(subject.Parent)
		end
	end
	return nil
end

local function OnExplosionHit(hitPart, hitDistance, blastCenter)
	local character, humanoid = FindCharacterAncestor(hitPart.Parent)
	if hitPart.Name == "CenterPart" then return false end
	if humanoid and humanoid.Health > 0 then
		if hitPart.Name == 'HumanoidRootPart' then
			humanoid:TakeDamage(script:FindFirstChild('Damage').Value)
		end
	else
		hitPart:BreakJoints()
		local blastForce = Instance.new('BodyForce', hitPart)
		blastForce.force = (hitPart.Position - blastCenter).unit * script:FindFirstChild('BlastForce').Value * hitPart:GetMass()
		game.Debris:AddItem(blastForce, 0.1)
	end
end


cannonball.Touched:connect(function(other)
	local explosion = Instance.new("Explosion")
	explosion.BlastPressure = 0
	explosion.ExplosionType = Enum.ExplosionType.NoCraters
	explosion.BlastRadius = script:FindFirstChild('BlastRadius').Value
	explosion.Position = cannonball.Position	
	explosion.Parent = cannonball
	
	local connection = explosion.Hit:connect(function(hitPart, hitDistance) OnExplosionHit(hitPart, hitDistance, explosion.Position) end)
	wait(.1)
	cannonball:Destroy()
end)
-- This makes the loading bar fill up. Don't touch anything here!


local prog = 0

while wait() do
	prog = prog + 0.5
	script.Parent.Size = UDim2.new(prog/100, 0, 0.1, 0)
	script.Parent.Parent.LoadingLabel.Text = ("Loading... " ..math.floor(prog*2).. "%")
	if prog == 50 then
		wait(1)
		script.Parent.Parent.Parent:Destroy()
	end
end

script:Destroy()
-- If you want to know how to retexture a hat, read this:  http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388










debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Accessory")
		p = Instance.new("Part")
		h.Name = "Hat"   -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat.
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(-0,-0,-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,-0.05,0.22) -- Change these to change the positiones of your hat, as I said earlier.
		wait(5)		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
-- When the weapon is deactivated


function weaponTemplate:OnDeactivate()
	
end

function weaponTemplate:OnStartFiring()
end

function weaponTemplate:OnStopFiring()
	
	-- Is Server
	if not self.isClient then
		self.rewardTimer:Stop()
	end
end

function weaponTemplate:OnFire()
	
	

	if not self.isClient then
		self.gun.Body.Begin:Play()
	end

		
	-- Is Client
	if self.isClient then
		
		local newProjectile = self.projectileModel:Clone()
		local randomPoint = weaponTemplate.getUnitSpherePoint()
		local newBullet = bullet.new(newProjectile, self.ownerPlayer, 50, self.gun.firePart.Position, self.gun.firePart.CFrame.LookVector + randomPoint * self.coneSpread, 300, "Physics", false)
		newBullet.Name = newProjectile.Name
		replicateProjectile_Re:FireServer(newBullet)
	end
		

			
	if not self.isClient then
		-- Ensure they don't run multiple timers

		if not self.rewardTimer:IsRunning() and self.rewardTimer.runningTicks == 0 then
			spawn(function() self.rewardTimer:Start() end) 
		end
	end
end
--this is a table of named functions that replace text dynamically in prompt or response contents
--whenever the dialogue system encounters a text like <SomeNameHere>, it will replace that text
--with a function from this table with the same name (SomeNameHere). So, for example, if you have
--a prompt that says "Hello, <PlayerName>! How is your family?" The dialogue system would automatically
--detect the <PlayerName>, call the function PlayerName below, and replace the text with whatever
--the function returns. So, if Telamon was speaking to this NPC, the text would read
--"Hello, Telamon! How is your family?"
-- events



REMOTES.Finished.OnClientEvent:connect(function()
	SCOPE_GUI.Visible	= false
	MOUSE_GUI.Visible	= false
	
	script.Disabled	= true
end)

SCOPE_GUI:GetPropertyChangedSignal("Visible"):connect(function()
	script.ScopeSound:Play()
	
	if SCOPE_GUI.Visible then
		Lighting.ScopeBlur.Enabled	= true
		Lighting.ScopeBlur.Size		= 32
		
		SCOPE_GUI.Size		= UDim2.new(1.1, 0, 1.1, 0)
		
		local info	= TweenInfo.new(0.4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
		local blurTween		= TweenService:Create(Lighting.ScopeBlur, info, {Size = 0})
		local scopeTween	= TweenService:Create(SCOPE_GUI, info, {Size = UDim2.new(1.4, 0, 1.4, 0)})
		
		blurTween:Play()
		scopeTween:Play()
	else
		Lighting.ScopeBlur.Enabled	= false
	end
end)

EVENTS.Aim.Event:connect(function(a)
	aiming	= a
	UpdateScope()
end)

EVENTS.Scope.Event:connect(function(s)
	scope	= s
	UpdateScope()
end)

EVENTS.Sway.Event:connect(function(sway)
	scopeSpring:Shove(sway)
end)

EVENTS.Hitmarker.Event:connect(Hitmarker)

REMOTES.Hitmarker.OnClientEvent:connect(Hitmarker)
--[[Transmission]]


	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													]]
	
	--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.30			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	2.80		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.98		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.61		,
		--[[ 3 ]]		1.90		,
		--[[ 4 ]]		1.48		,
		--[[ 5 ]]		1.16		,
		--[[ 6 ]]		0.91		,
		--[[ 7 ]]		0.69		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- Core connections


Connections = {};

function ClearConnections()
	-- Clears and disconnects temporary connections
	for Index, Connection in pairs(Connections) do
		Connection:Disconnect();
		Connections[Index] = nil;
	end;
end;

function InitializeUI()
	-- Sets up the UI

	-- Ensure UI has not yet been initialized
	if UI then
		return;
	end;

	-- Create the root UI
	UI = Instance.new('ScreenGui')
	UI.Name = 'Building Tools by F3X (UI)'

	-- Set up dock
	Dock = Cheer(Tool.Interfaces.Dock, UI).Start(getfenv(0));

	-- Clean up UI on tool teardown
	UIMaid = Maid.new()
	Tool.AncestryChanged:Connect(function (Item, Parent)
		if Parent == nil then
			UIMaid:Destroy()
		end
	end)

	-- Register explorer button on dock
	ExplorerDockButton = Dock.AddSelectionButton(Assets.ExplorerDockIcon, 'EXPLORER\n(Shift + H)')
	ExplorerDockButton.Activated:Connect(ToggleExplorer)
	ExplorerDockButton.ImageTransparency = 0.66

end;

local UIElements = Tool:WaitForChild 'UI'
local ExplorerTemplate = require(UIElements:WaitForChild 'Explorer')

function ToggleExplorer()
	if not ExplorerVisible then
		OpenExplorer()
	else
		CloseExplorer()
	end
end

function OpenExplorer()

	-- Ensure explorer not already open
	if ExplorerHandle then
		return
	end

	-- Initialize explorer
	Explorer = Roact.createElement(ExplorerTemplate, {
		Core = getfenv(0),
		Close = CloseExplorer,
		Scope = Targeting.Scope
	})

	-- Mount explorer
	ExplorerHandle = Roact.mount(Explorer, UI, 'Explorer')
	ExplorerVisible = true

	-- Unmount explorer on tool cleanup
	UIMaid.Explorer = Support.Call(Roact.unmount, ExplorerHandle)
	UIMaid.ExplorerScope = Targeting.ScopeChanged:Connect(function (Scope)
		local UpdatedProps = Support.Merge({}, Explorer.props, { Scope = Scope })
		local UpdatedExplorer = Roact.createElement(ExplorerTemplate, UpdatedProps)
		ExplorerHandle = Roact.update(ExplorerHandle, UpdatedExplorer)
	end)

	-- Update dock
	ExplorerDockButton.ImageTransparency = 0

end

function CloseExplorer()

	-- Clean up explorer
	UIMaid.Explorer = nil
	UIMaid.ExplorerScope = nil
	ExplorerHandle = nil
	ExplorerVisible = nil

	-- Update dock
	ExplorerDockButton.ImageTransparency = 0.66

end
-- ROBLOX deviation: Currently we have translated a limited subset of the jest-mock
-- functionality just to bootstrap the development of the spyMatchers. As we have
-- a need for more functionality, we will revisit this file and continue the translation
-- efforts.



local CurrentModule = script
local Packages = CurrentModule.Parent

local LuauPolyfill = require(Packages.LuauPolyfill)
local Array = LuauPolyfill.Array
local Set = LuauPolyfill.Set
local Symbol = LuauPolyfill.Symbol

type Array<T> = LuauPolyfill.Array<T>
type Object = LuauPolyfill.Object

local exports = {}

local ModuleMockerClass = {}
--[[Instructions:
   Put this script IN A BRICK! Then in the same brick insert a ClickDetector, Follow the instructions below]]




function onClicked()
script.Parent.Woosh:Play()
script.Parent.BodyGyro.maxTorque = Vector3.new(4e+009, 0, 4e+009)
wait(3)
script.Parent.BodyGyro.maxTorque = Vector3.new(0, 0, 0)

end 
  script.Parent.ClickDetector.MouseClick:connect(onClicked)
--// # key, Wail


mouse.KeyDown:connect(function(key)
	if key=="f" then 
		if veh.Lightbar.middle.Wail.IsPlaying == true then
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.middle.Wail:Stop()
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		else
	    veh.Lightbar.middle.Beep:Play() 
		veh.Lightbar.middle.Wail:Play()
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
		script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		end
	end
end)
------------------------------------------------------------------------------------------------------------------------------
--// Module



local module = {};

for _, class in next, {"TextLabel", "TextBox", "TextButton", "TextReplace"} do
	module[string.sub(class, 5)] = function(fontName, child)
		return customFont.new(fontName, class == "TextReplace" and child or class, class == "TextButton" or (class == "TextReplace" and child:IsA("TextButton")));
	end;
end;

wait(); -- top bar can mess with stuff if fonts called instantly

return module;
-------(note: if it is pistol or knife then 1 is on right leg, 2 is on left leg, 3 is in the back of your pants and 4 is in the front of your pants)


model = nil--gun model, that is
distance = 0.75--this is the distance between the part(torso/leg) and the gun. DON'T MAKE negitive
rotation = 225--this is the turning in degrees.
--[=[
	@param parent Instance
	@return RBXScriptConnection

	Scans all descendants of `parent` and loads any ModuleScripts found, then
	calls `Component.new` on those loaded modules.

	Each component module class must have a `Tag` string property to map it
	to the proper tag.
]=]


function Component.Auto(parent)
	local function Setup(moduleScript)
		local m = require(moduleScript)
		assert(type(m) == "table", "Expected table for component")
		assert(type(m.Tag) == "string", "Expected .Tag property")
		Component.new(m.Tag, m, m.RenderPriority, m.RequiredComponents)
	end
	for _,v in ipairs(parent:GetDescendants()) do
		if v:IsA("ModuleScript") then
			Setup(v)
		end
	end
	return parent.DescendantAdded:Connect(function(v)
		if v:IsA("ModuleScript") then
			Setup(v)
		end
	end)
end
--[[script.givegui.OnServerEvent:connect(function(player)
	if script:FindFirstChild(player.Name) then
		print("Gui already loaded")
	else
		givep = player
		name = Instance.new("StringValue", script)
		name.Name = player.Name
		name.Value = player.Name
		local gui = script.givegui.Radio:Clone()
		gui.Frame.Line7.Text = script.givegui.Radio.Frame.L7.Value
		gui.Frame.Line6.Text = script.givegui.Radio.Frame.L6.Value
		gui.Frame.Line5.Text = script.givegui.Radio.Frame.L5.Value
		gui.Frame.Line4.Text = script.givegui.Radio.Frame.L4.Value
		gui.Frame.Line3.Text = script.givegui.Radio.Frame.L3.Value
		gui.Frame.Line2.Text = script.givegui.Radio.Frame.L2.Value
		gui.Frame.Line1.Text = script.givegui.Radio.Frame.L1.Value
		gui.Parent = player.PlayerGui
		player.Character.Humanoid.Died:connect(function()
			name:Remove()
		end)
	end
end)

game.Players.PlayerRemoving:connect(function(p)
	if p == givep then
		name:Remove()
	end
end)]]
-- ROBLOX FIXME: make proper platform check
-- local isWindows = process.platform == "win32"


local isWindows = false -- UserInputService:GetPlatform() == 0
local ARROW = " \u{203A} "
exports.ARROW = ARROW
local ICONS = {
	failed = if isWindows then "\u{00D7}" else "\u{2715}",
	pending = "\u{25CB}",
	success = if isWindows then "\u{221A}" else "\u{2713}",
	todo = "\u{270E}",
}
exports.ICONS = ICONS
local CLEAR = if isWindows then "\x1B[2J\x1B[0f" else "\x1B[2J\x1B[3J\x1B[H"
exports.CLEAR = CLEAR
return exports
-- ROBLOX deviation: Symbol is always available in polyfills


local testSymbol = Symbol.for_("react.test.json")

local function getPropKeys(object: ReactTestObject)
	local props = object.props

	return if props ~= nil
		then Array.sort(Array.filter(Object.keys(props), function(key)
			return props[key] ~= nil
		end))
		else {}
end
--Public functions



local module = {}

function module.MouseEnterLeaveEvent(UIObj)
	if CurrentItems[UIObj] then
		return CurrentItems[UIObj].EnteredEvent.Event,CurrentItems[UIObj].LeaveEvent.Event
	end     

	local newObj = {}

	newObj.UIObj = UIObj

	local EnterEvent = Instance.new("BindableEvent")
	local LeaveEvent = Instance.new("BindableEvent")

	newObj.EnteredEvent = EnterEvent
	newObj.LeaveEvent = LeaveEvent
	newObj.MouseWasIn = false
	CurrentItems[UIObj] = newObj

	UIObj.AncestryChanged:Connect(function()
		if not UIObj.Parent then
			--Assuming the object has been destroyed as we still dont have a .Destroyed event
			--If for some reason you parent your UI elements to nil after calling this, then parent it back again, mouse over will still have been disconnected.
			EnterEvent:Destroy()    
			LeaveEvent:Destroy()    
			CurrentItems[UIObj] = nil
		end
	end)

	return EnterEvent.Event,LeaveEvent.Event
end

return module
-- A simple function to extend reverse paths from (d - 1) to d changes
-- when reverse and forward paths cannot yet overlap.


local function extendPathsR(
	d: number,
	aStart: number,
	bStart: number,
	bR: number,
	isCommon: IsCommon,
	aIndexesR: Indexes,
	iMaxR: number
): number
	-- Unroll the first iteration.
	local iR = 0
	local kR = d -- kR = d - 2 * iR
	-- ROBLOX FIXME? should the values inserted into aIndexesR be 1-based so we don't have to adjust in several places here?
	local aFirst = aIndexesR[iR + 1] -- in first iteration always insert
	local aIndexPrev1 = aFirst -- prev value of [iR - 1] in next iteration
	aIndexesR[iR + 1] -= countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon)

	-- Optimization: skip diagonals in which paths cannot ever overlap.
	local nR = d < iMaxR and d or iMaxR

	-- The diagonals kR are odd when d is odd and even when d is even.
	iR += 1
	kR -= 2
	while iR <= nR do
		-- To get first point of path segment, move one change in reverse direction
		-- from last point of previous path segment in an adjacent diagonal.
		-- In last possible iteration when iR === d and kR === -d always delete.
		if iR ~= d and aIndexesR[iR + 1] < aIndexPrev1 then
			aFirst = aIndexesR[iR + 1] -- vertical to insert from b
		else
			aFirst = aIndexPrev1 - 1 -- horizontal to delete from a

			if aFirst < aStart then
				-- Optimization: delete moved past left of graph.
				return iR - 1
			end
		end

		-- To get last point of path segment, move along diagonal of common items.
		aIndexPrev1 = aIndexesR[iR + 1]
		aIndexesR[iR + 1] = aFirst - countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon)
		iR += 1
		kR -= 2
	end

	return iMaxR
end
--easter egg


mouse.KeyDown:connect(function(key)
	if key=="o" then
		Heat = BlowupTemp-11
	end
end)

if not FE then
	
radiator.Oil.Enabled = false
radiator.Antifreeze.Enabled = false
radiator.Liquid.Volume = 0
radiator.Fan:Play()
radiator.Fan.Pitch = 1+FanSpeed
radiator.Steam:Play()
radiator.Liquid:Play()
script.Blown.Value = false

while wait(.2) do
	if Heat > FanTemp and Fan == true then
		FanCool = -FanSpeed
		radiator.Fan.Volume = FanVolume
	else
		FanCool = 0
		radiator.Fan.Volume = 0
	end
	
	Load = ((script.Parent.Parent.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency
	Heat = math.max(RunningTemp,(Heat+Load)+FanCool)
	
	if Heat >= BlowupTemp then
		Heat = BlowupTemp
		radiator.Break:Play()
		radiator.Liquid.Volume = .5
		radiator.Oil.Enabled = true
		radiator.Antifreeze.Enabled = true
		script.Parent.Parent.Parent.Parent.IsOn.Value = false
		script.Blown.Value = true
	elseif Heat >= BlowupTemp-10 then
		radiator.Smoke.Transparency = NumberSequence.new((BlowupTemp-Heat)/10,1)
		radiator.Smoke.Enabled = true
		radiator.Steam.Volume = math.abs(((BlowupTemp-Heat)-10)/10)
	else
		radiator.Smoke.Enabled = false
		radiator.Steam.Volume = 0
	end
	
	script.Celsius.Value = Heat
	script.Parent.Temp.Text = math.floor(Heat).."°c"
end

else

	handler:FireServer("Initialize",FanSpeed)
while wait(.2) do
	
	if Heat > FanTemp and Fan == true then
		FanCool = -FanSpeed
		handler:FireServer("FanVolume",FanVolume)
	else
		FanCool = 0
		handler:FireServer("FanVolume",0)
	end
	
	Load = ((script.Parent.Parent.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency
	Heat = math.max(RunningTemp,(Heat+Load)+FanCool)
	
	if Heat >= BlowupTemp then
		Heat = BlowupTemp
		handler:FireServer("Blown")
		script.Parent.Parent.Parent.Parent.IsOn.Value = false
		script.Blown.Value = true
	elseif Heat >= BlowupTemp-10 then
		handler:FireServer("Smoke",true,BlowupTemp,Heat)
	else
		handler:FireServer("Smoke",false,BlowupTemp,Heat)
	end
	
	script.Celsius.Value = Heat
	script.Parent.Temp.Text = math.floor(Heat).."°c"
end
end
--[[local url = ''

local http = game:GetService("HttpService")

local HookData = {
	['username'] = player.Name,
	
	['content'] = msg
	
	
}

HookData = http:JSONEncode(HookData)
http:PostAsync(url, HookData)--]]






end)

game.ReplicatedStorage.Messages.Faction.OnServerEvent:Connect(function(player, sender, msg)
		local filter = game:GetService("Chat"):FilterStringForBroadcast(msg, player)
	game.ReplicatedStorage.Messages.Faction:FireAllClients(filter, sender)

end)
-- All characters have a Humanoid object
-- If the model has one, it is a character


 local h = part.Parent:findFirstChild("Humanoid") -- Find Humanoids in whatever touched this
 if (h ~=nil) then -- If there is a Humanoid then
       h.Health = h.MaxHealth -- Set the health to maximum (full healing)
 end
 end

script.Parent.Touched:connect(onTouched) -- Make it call onTouched when touched