Script Not Detecting If Something Is Grater Than Tan Or Less Than -10

I am trying to get the script below to detect if a value is over 10 or under -10
The Script In Question:

local players = game:GetService(“Players”)
local player = players.LocalPlayer
local id = 4189170776180288

local planet = game.Workspace:WaitForChild(“Planet”)

while true do
if script.Parent.Parent.Parent.Parent.Gamepass.Cangooverten == true then
else
if script.Parent.RotSpeed.Value < 10 or script.Parent.RotSpeed.Value > -10 then
planet.Orientation = planet.Orientation + Vector3.new(0,script.Parent.Text,0)
else
game:GetService(“MarketplaceService”):PromptGamePassPurchase(player, id)
script.Parent.RotSpeed.Value = 10
end
end
wait(0.00001)
end

this is in startergui

Found it if anyone want to get it, its is:

local players = game:GetService("Players")
local player = players.LocalPlayer
local id = 4189170776180288

local planet = game.Workspace:WaitForChild("Planet")

while true do
	if script.Parent.Parent.Parent.Parent.Gamepass.Cangooverten == true then
	else
		if script.Parent.RotSpeed.Value > 10  then
			game:GetService("MarketplaceService"):PromptGamePassPurchase(player, id)
			script.Parent.RotSpeed.Value = 10
		else
			if script.Parent.RotSpeed.Value < -10 then
				game:GetService("MarketplaceService"):PromptGamePassPurchase(player, id)
				script.Parent.RotSpeed.Value = -10
			end
		end
	end
	wait(0.0001)
end

Almost exactly what I came up with. Other than wait(0.0001) is way to low.

local rns = game:GetService("RunService")
--
while true do rns.Stepped:Wait()

What is run service I and really understand it well I just know heartbeat

Runservice updates prior to a new frame rendering

And for Performance purposes use The Event :GetPropertyChangedSignal or Changed to detect a change in a value instead of a loop

like while:GetPropertyChangedSignal?

more like:
script.Parent.RotSpeed:GetPropertyChangedSignal(“Value”):Connect(function()
–write code here
end)

ohhh okay Thank you for your help