local I=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local j=require(I.GraspDetection)local b=script.Parent.Thresholds local o,u=b.ThresholdName,b.ThresholdValue local K=j.GetThresholds()local t=1 o.Text=K[t]u.Text=j.GetThresholdValue(K[t])o.Activated:Connect(function()t+=1 if t>#K then t=1 end o.Text=K[t]u.Text=j.GetThresholdValue(K[t])end)u.FocusLost:Connect(function(I)if not I then return end j.UpdateThreshold(K[t],tonumber(u.Text))u.Text=j.GetThresholdValue(K[t])end)
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GraspDetection = require(ReplicatedStorage.GraspDetection)

local Thresholds = script.Parent.Thresholds
local TName, TValue = Thresholds.ThresholdName, Thresholds.ThresholdValue

local THRESHOLDS = GraspDetection.GetThresholds()
local ThresholdIndex = 1

TName.Text = THRESHOLDS[ThresholdIndex]
TValue.Text = GraspDetection.GetThresholdValue(THRESHOLDS[ThresholdIndex])

TName.Activated:Connect(function()
	ThresholdIndex += 1

	if ThresholdIndex > #THRESHOLDS then
		ThresholdIndex = 1
	end

	TName.Text = THRESHOLDS[ThresholdIndex]
	TValue.Text = GraspDetection.GetThresholdValue(THRESHOLDS[ThresholdIndex])
end)

TValue.FocusLost:Connect(function(enterPressed)
	if not enterPressed then
		return
	end

	GraspDetection.UpdateThreshold(THRESHOLDS[ThresholdIndex], tonumber(TValue.Text))
	TValue.Text = GraspDetection.GetThresholdValue(THRESHOLDS[ThresholdIndex])
end)
