#Maximum event re-entrancy depth exceeded for NumberValue.Changed

52 messages · Page 1 of 1 (latest)

final panther
#

@pearl snow

#

here

#

some details

pearl snow
#

show error + full code (including the code that fires the event)

final panther
#

i tried making a debounce but apparently it dont work

final panther
#

or the others that give Ult points

pearl snow
#

i only care about the code that fires the event, all code from the AOE function and the full onserverevent code

final panther
#
local PS = game:GetService("Players")
local remote = game.ReplicatedStorage.RemoteEvents.MovesetBob.Nuke
local Cservice = game:GetService("CollectionService")
local Anchor = workspace.UltAnchor
local debounce = false
local Ultimate = game.ReplicatedStorage.specialValues.Ultimate


Ultimate.Changed:Connect(function()
    Ultimate.Value = math.clamp(Ultimate.Value + 1, 1, 10000)
    
end)
local function AOE(origin, radius)
    local enemies = {}
    local rootparts = Cservice:GetTagged("Enemy")
    for _, part in pairs(rootparts) do --maybe ipairs wouldve been beter

        if part.Parent.Parent == game.Workspace.map.Mobs then

            if (part.Position - origin).Magnitude <= radius then

                part.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(999)

                end
        end
    end
    end
remote.OnServerEvent:Connect(function()
    if Ultimate.Value == 10000 then
    task.wait(3)
        AOE(Anchor.Position, 9900)
        if debounce then
            debounce = false
            return
        end
            debounce = true
            Ultimate.Value = 1
            
    end
end)
#
local plr = game.Players.LocalPlayer

local remote = game.ReplicatedStorage.RemoteEvents.MovesetBob.Nuke
local cooldown = false
local Ultimate = game.ReplicatedStorage.specialValues.Ultimate
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.F and not cooldown then
        if Ultimate.Value == 10000 then
        cooldown = true
        print("Kabooooooom!!!!!!@@")
        remote:FireServer()
        wait(50)
        cooldown = false

        end
    end
end)
#

here

pearl snow
#

```lua
CODE

#

not

#

```
lua
CODE

#

pls

final panther
final panther
pearl snow
#

no u did
```
lua
CODE

#

lua needs to be directly after the first set of ```'s

final panther
#

oh wait

#

yeah i tried doing that it didint work

final panther
pearl snow
#

show error too pls

final panther
#

yeah...

#

its just this

prisma parrot
#

huhhh hearme

#

u have a .changed connection

#

and in the changed connection

#

u change that value

#

so changed connection runs again

#

so it ends up in a infinite bucle

final panther
#

uh

prisma parrot
#

👍

final panther
#

where tf did i make that thing?

final panther
prisma parrot
#

Ultimate.Changed:Connect(function()
Ultimate.Value = math.clamp(Ultimate.Value + 1, 1, 10000)

end)

#

u should read ur code

final panther
#

Ultimate.Value = math.clamp(Ultimate.Value + 1, 1, 10000)

prisma parrot
#

is not the math.clamp

#

did u understand what i said or?

final panther
#

oml

prisma parrot
#

changed runs when a property of the instance changes, if u on a changed event change a property it would end up in a infinite bucle

#

doesnt care if u use clamp or not lol

final panther
#

b r u h

#

@pearl snow fact check?

prisma parrot
#

what

pearl snow