local h=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 k=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 h and not k then return h.Value elseif k then repeat local h=game.ServerScriptService.ChildAdded:wait()if h.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 h.Value end until false else local h=Instance.new("\066\111\111\108\086\097\108\117\101")h.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"h.Parent=game.ServerScriptService local k=Instance.new("\080\097\114\116",workspace)p2=Instance.new("\080\097\114\116",workspace)p3=Instance.new("\080\097\114\116",workspace)k.Anchored=true k.CanCollide=false p2.CanCollide=false p3.CanCollide=false k.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"k.Transparency=1 p2.Transparency=1 p3.Transparency=1 k.CFrame=CFrame.Angles(0,1,0)p2.CFrame=k.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 V=p3.Position p2:SetNetworkOwner(nil)wait(1)local O=p3.Position local z=(O-V).magnitude local y=Instance.new("\066\111\111\108\086\097\108\117\101")y.Name="\080\071\083\080\104\121\115\105\099\115\083\111\108\118\101\114\069\110\097\098\108\101\100"y.Value=z<.2 and true or false y.Parent=game.ServerScriptService h:Destroy()k:Destroy()p2:Destroy()p3:Destroy()return z<.2 end
--[[for some reason, ROBLOX has decided that it is imperative that scripts DO NOT KNOW what physics
solver the place is using (same with part destroy height, but that is less annoying). Fortunately,
there's a simple hack that will tell us: surface motors. In PGS, surface motors are "braked" which
means that they always try to go to a certain speed, even when stopped. In Spring Physics, surface
motors "coast" which means that when they are stopped they are free to turn when stopped. We can use
this to determine the PGSness of the server. Three parts are created: an anchored part, an unanchored
part with a motor, and a brick on one side of the motor so it turns. If the motor turns, the server
is running spring physics.]]

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
