#is there a max amount of remove events i can have pending atonce?

1 messages Β· Page 1 of 1 (latest)

kindred leaf
dusk forge
pastel stirrup
#

wtf is this lol, aint any way to optimize??!??!?!?!

#

what are you even trying to do????

kindred leaf
#

update inventory

hushed shadow
#

πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€

#

πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€ πŸ₯€

ionic cape
#

is ts satireπŸ’” πŸ₯€ πŸ«’πŸ«’πŸ«’πŸ«’

hushed shadow
#

🀯

tranquil swift
#

use one remote bro

kindred leaf
#

It’s single player game

tranquil swift
kindred leaf
#

Try to hel[p in scripting help challenge
this is what worked for me

local function connectChangedEvents(instances, callback)
    for _, instanceName in ipairs(instances) do
        local inst = playerstats:WaitForChild(instanceName)
        inst.Changed:Connect(callback)
    end
end


local equipmentStats = {
    "SkillSlot1", "SkillSlot2", "SkillSlot3",
    "Weapon",
    "ToolSlot1", "ToolSlot2",
    "SkillBind1", "SkillBind2", "SkillBind3",
    "ToolBind1", "ToolBind2"
}



connectChangedEvents(equipmentStats, LoadEquipment)

-- Backpack events
backpack = game.ReplicatedStorage.Backpacks[player.Name]
backpack.ChildAdded:Connect(LoadBackpackItems)
backpack.ChildRemoved:Connect(LoadBackpackItems)




hushed shadow
#

at all

#

πŸ₯€

inner mist
# kindred leaf Try to hel[p in scripting help challenge this is what worked for me ```lua local...
local function connectChangedEvents(instances, callback)
    for _, instanceName in ipairs(instances) do
        local inst = playerstats:WaitForChild(instanceName)
        inst.Changed:Connect(callback)
    end
end

local equipmentStats = {
    "SkillSlot1", "SkillSlot2", "SkillSlot3",
    "Weapon",
    "ToolSlot1", "ToolSlot2",
    "SkillBind1", "SkillBind2", "SkillBind3",
    "ToolBind1", "ToolBind2"
}

game.ReplicatedStorage.EquipmentChanged.Event:Connect(function()
    LoadEquipment()
end)

connectChangedEvents(equipmentStats, function()
    game.ReplicatedStorage.EquipmentChanged:Fire()
end)

backpack = game.ReplicatedStorage.Backpacks[player.Name]
backpack.ChildAdded:Connect(LoadBackpackItems)
backpack.ChildRemoved:Connect(LoadBackpackItems)```

make sure to create a bindable event not a remote event since you said ur game is singleplayer
inner mist
#

because it gives you a single centralized channel instead of like 20 direct .changed connections

#

loading each stat one by one is just inefficient πŸ‘

kindred leaf
#

sorry im kinda bad at optimizing type shit

inner mist
#

u can use a remoteevent but bindableevent is better since its a singleplayer game

kindred leaf
inner mist
kindred leaf