Works with other script which checks every second for a different stat, this is for fist strength so I had to make it check if they're clicking, I think I might've done it wrong though
local plr = game.Players.LocalPlayer
local char = plr.Character
local db = false
local zone = script.Parent.Check
local selected = script.Parent.Parent.SelectFS
local mouse = plr:GetMouse()
while wait(0.1) do
local region = Region3.new(regionPart.Position - (regionPart.Size/2), regionPart.Position + (regionPart.Size/2))
local allParts = game.Workspace:FindPartsInRegion3WithWhiteList(region, char:GetDescendants())
isInRegion = false
for i, part in pairs(allParts) do
if part:FindFirstAncestor(plr.Name) then
isInRegion = true
end
end
end
mouse.Button1Down:Connect(function()
if isInRegion == true then
if db == false and selected.Visible == true then
script.Fired.Gain:FireServer()
print("zone works!")
db = true
zone.Value = 2
wait(1)
db = false
end
end
end)```