for N,U in pairs(script.Parent:GetChildren())do local F=U:FindFirstChild("\084\111\117\099\104\080\097\114\116")if F then local N={}local U=F.Color local J=F.Particles F.Touched:Connect(function(O)local M=O.Parent local z=players:GetPlayerFromCharacter(M)if z and not N[z]then N[z]=true local O,e,v=hd:GetRank(z)local w=errorColor if O<=rankId then hd:UnRank(z)w=successColor else local N="\089\111\117\114 \114\097\110\107 \105\115 \116\111\111 \104\105\103\104 \116\111 \098\101 \117\110\114\097\110\107\101\100\033"hd:Error(z,N)end F.Color=w if w==successColor then local N=M:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if N and J then local U=J:Clone()debris:AddItem(U,3)U.Parent=N for N,U in pairs(U:GetChildren())do U:Emit(2)end end end local b=tweenService:Create(F,TweenInfo.new(2),{Color=U})b:Play()b.Completed:Wait()N[z]=false end end)end end
-- << MAIN >>
--Touch Pad
for a, b in pairs(script.Parent:GetChildren()) do
	local touchPart = b:FindFirstChild("TouchPart")
	if touchPart then
		local touchDe = {}
		local originalColor = touchPart.Color
		local particles = touchPart.Particles
		touchPart.Touched:Connect(function(hit)
			local character = hit.Parent
			local player = players:GetPlayerFromCharacter(character)
			if player and not touchDe[player] then
				touchDe[player] = true

				--Check rank is lower or equal to giver rank
				local plrRankId, plrRankName, plrRankType = hd:GetRank(player)
				local newColor = errorColor
				if plrRankId <= rankId then
					--Remove rank
					hd:UnRank(player)
					newColor = successColor
				else
					local errorMessage = "Your rank is too high to be unranked!"
					hd:Error(player, errorMessage)
				end

				--Change pad color
				touchPart.Color = newColor

				--Success effect
				if newColor == successColor then
					local hrp = character:FindFirstChild("HumanoidRootPart")
					if hrp and particles then
						local particlesClone = particles:Clone()
						debris:AddItem(particlesClone, 3)
						particlesClone.Parent = hrp
						for _, effect in pairs(particlesClone:GetChildren()) do
							effect:Emit(2)
						end
					end
				end

				--Revert pad color
				local tween = tweenService:Create(touchPart, TweenInfo.new(2), { Color = originalColor })
				tween:Play()
				tween.Completed:Wait()

				touchDe[player] = false
			end
		end)
	end
end
