#Maximum event re-entrancy depth exceeded for NumberValue.Changed
52 messages · Page 1 of 1 (latest)
show error + full code (including the code that fires the event)
i tried making a debounce but apparently it dont work
specificaly the nuke scripts?
or the others that give Ult points
i only care about the code that fires the event, all code from the AOE function and the full onserverevent code
i mean, there are other scripts that manipulate the value of Ultimate but alright
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
yes i did that
wait whuh
show error too pls
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
uh
👍
where tf did i make that thing?
no, no thumbs up
Ultimate.Changed:Connect(function()
Ultimate.Value = math.clamp(Ultimate.Value + 1, 1, 10000)
end)
u should read ur code
ITS THE FUCKING CLAMPING YOU IDIOT
Ultimate.Value = math.clamp(Ultimate.Value + 1, 1, 10000)
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
what
yk what i cannot be bothered to help you if this is how you treat ppl who try to help u, bai