#Not Printing

4 messages · Page 1 of 1 (latest)

sleek sapphire
#

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)```
#

Update: Fixed

local plr = game.Players.LocalPlayer
local char = plr.Character
local selected = script.Parent.Parent.SelectFS
local Players = game:GetService("Players")
local event = script.Fired.Gain
local player = Players.LocalPlayer
local mouse = player:GetMouse()
local db = false

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
    mouse.Button1Down:Connect(function()
    if isInRegion == true then
            if db == false and selected.Visible == true then
            print("works")
            event:FireServer()
            db = true
            wait(1)
            db = false
        else wait()
            end
        end
    end)
end```
#

dont understand how i fixed it

#

ut good enough