local g=game.ServerScriptService:FindFirstChild("\080\071\083\080\104\121\115\105\099\115\083\111\108\118\101\114\069\110\097\098\108\101\100")local r=game.ServerScriptService:FindFirstChild("\080\071\083\080\104\121\115\105\099\115\083\111\108\118\101\114\069\110\097\098\108\101\100 \084\069\077\080")if g and not r then return g.Value elseif r then repeat local g=game.ServerScriptService.ChildAdded:wait()if g.Name=="\080\071\083\080\104\121\115\105\099\115\083\111\108\118\101\114\069\110\097\098\108\101\100"then return g.Value end until false else local g=Instance.new("\066\111\111\108\086\097\108\117\101")g.Name="\080\071\083\080\104\121\115\105\099\115\083\111\108\118\101\114\069\110\097\098\108\101\100 \084\069\077\080"g.Parent=game.ServerScriptService local r=Instance.new("\080\097\114\116",workspace)p2=Instance.new("\080\097\114\116",workspace)p3=Instance.new("\080\097\114\116",workspace)r.Anchored=true r.CanCollide=false p2.CanCollide=false p3.CanCollide=false r.FormFactor="\083\121\109\109\101\116\114\105\099"p2.FormFactor="\083\121\109\109\101\116\114\105\099"p3.FormFactor="\083\121\109\109\101\116\114\105\099"r.Transparency=1 p2.Transparency=1 p3.Transparency=1 r.CFrame=CFrame.Angles(0,1,0)p2.CFrame=r.CFrame*CFrame.new(0,0,-2)p3.CFrame=p2.CFrame*CFrame.new(3,1,0)p2.BackSurface="\077\111\116\111\114"p2:MakeJoints()p3:MakeJoints()local J=p3.Position p2:SetNetworkOwner(nil)wait(1)local Q=p3.Position local O=(Q-J).magnitude local p=Instance.new("\066\111\111\108\086\097\108\117\101")p.Name="\080\071\083\080\104\121\115\105\099\115\083\111\108\118\101\114\069\110\097\098\108\101\100"p.Value=O<.2 and true or false p.Parent=game.ServerScriptService g:Destroy()r:Destroy()p2:Destroy()p3:Destroy()return O<.2 end


local Value = game.ServerScriptService:FindFirstChild("PGSPhysicsSolverEnabled")
local Temporary = game.ServerScriptService:FindFirstChild("PGSPhysicsSolverEnabled TEMP")

if Value and not Temporary then--we want to be as lazy as possible. If another script already figured
	return Value.Value--out if the server is PGS or not, then lets just use their discovery
elseif Temporary then
	repeat--because it takes a second for the script to run, we want to make sure that we don't flood
	local inserted = game.ServerScriptService.ChildAdded:wait()--the thing with extra values.
	if inserted.Name == "PGSPhysicsSolverEnabled" then--but, we want to get back with the answer ASAP
		return inserted.Value
	end
	until false
else--well, it looks like this one will have to do the heavy lifting and run the test.
	local PGSTemp = Instance.new("BoolValue")--prevent a flood of values
	PGSTemp.Name = "PGSPhysicsSolverEnabled TEMP"
	PGSTemp.Parent = game.ServerScriptService
	local p1 = Instance.new("Part",workspace)
	p2 = Instance.new("Part",workspace)
	p3 = Instance.new("Part", workspace)
	p1.Anchored = true
	p1.CanCollide = false--having each property changed next to the others looks pretty
	p2.CanCollide = false
	p3.CanCollide = false
	p1.FormFactor = "Symmetric"
	p2.FormFactor = "Symmetric"
	p3.FormFactor = "Symmetric"
	p1.Transparency = 1
	p2.Transparency = 1
	p3.Transparency = 1
	p1.CFrame = CFrame.Angles(0,1,0)--this is to prevent things from accidentally welding to it
	p2.CFrame = p1.CFrame*CFrame.new(0,0,-2)
	p3.CFrame = p2.CFrame*CFrame.new(3,1,0)
	p2.BackSurface = "Motor"
	p2:MakeJoints()--makes sure that the unanchored parts don't fall apart
	p3:MakeJoints()
	local StartPos = p3.Position
	p2:SetNetworkOwner(nil)--make sure a pesky client doesn't get it!
	wait(1)--run the test
	local EndPos = p3.Position--test is over!
	local Magnitude = (EndPos-StartPos).magnitude--how much did the brick move?
	local PGSPhysicsSolverEnabledValue = Instance.new("BoolValue")
	PGSPhysicsSolverEnabledValue.Name = "PGSPhysicsSolverEnabled"
	PGSPhysicsSolverEnabledValue.Value = (Magnitude < 0.2) and true or false--if the brick moved a lot, then it's in Spring Physics
	PGSPhysicsSolverEnabledValue.Parent = game.ServerScriptService--let everyone else who was waiting know the outcome
	PGSTemp:Destroy()--this would cause major problems if it wasn't destroyed
	p1:Destroy()--clean up the test
	p2:Destroy()
	p3:Destroy()
	return Magnitude < 0.2--tell our script what the answer is
end
