humanoid:EquipTool(tool) not functioning properly (only on live servers)

I have a server script that runs a function when the players character appearance has loaded.

It takes a new tool from ReplicatedStorage, and clones it. (This function runs, its not a matter of the function not running due to race conditions or anything)

There is an issue with equipping the tool with the players humanoid after cloning, and depending on where you parent the tool before calling :EquipTool(), it may not work, or give strange results?

Some info about the tool:
Handle is required, and it has a part named Handle
All the parts inside are un-anchored, welded together, and have all cancollide/cantouch/canquery turned off

If i parent the tool directly in the players backpack and call :EquipTool() on it, it just stays in the players backpack, it refuses to parent to the players character, and stays put in the backpack. Using an AncestryChanged event, it will fire when its parented to the backpack, but wont fire again because it doesnt move.

local newWateringTool = wateringTool:Clone()
newWateringTool.AncestryChanged:Connect(function()
	print(newWateringTool.Parent)
end)

newWateringTool.Parent = player.Backpack

humanoid:EquipTool(newWateringTool)

If i parent the tool into the workspace and call :EquipTool(), it will equip the tool as needed, welds to the players hand and works! But the AncestryChanged event is kind of weird. If i hook up the AncestryChanged event before parenting it to the workspace, it wont fire when its parented to the workspace, and then will fire TWICE when it is added into my character through the humanoid:EquipTool() function.

local newWateringTool = wateringTool:Clone()
newWateringTool.AncestryChanged:Connect(function()
	print(newWateringTool.Parent)
end)

newWateringTool.Parent = Workspace

humanoid:EquipTool(newWateringTool)

This code will print lollypop99p (my character) twice in a single frame

The equipping works when pressing “Play” in studio, but if i try local servers, or a full roblox server, it bugs out as described above?

Expected behavior

I want the tool to equip after calling :EquipTool(), especially if it’s already in the players backpack

1 Like

I found the cause of the issue, however it’s still a bug!

When ModelStreamingBehavior is set to Improved, this bug occurs on live servers

When ModelStreamingBehavior is set to Default, this bug does not occur

1 Like

Are you able to share a repro place?

Yeah here you go

You can see that when ModelStreamingBehavior is set to Improved the tool doesnt equip and stays in the players backpack, but equips if its set to default

Are you still encountering this issue? I see the watering can being equipped every time in your repro place, both production client+server as well as in Studio.

Its still happening in the repro place i sent, i press Play in studio and the tool doesnt equip, its only in the players backpack (which its supposed to be equipped, not in the backpack)

Puzzling. I can’t reproduce this with clients or in Studio. I’ve tried play solo and server+client in Studio, no repro. I’ve also tried different devices and accounts.

Do you see this consistently on all platforms? All users?

You are testing this on this place, right?

I have tested this place in studio, every time i press Play the tool is not equipped, its place in the backpack (only when Improved), when its set to Default the tool equips just fine without being placed in the backpack

Sorry, I missed that the concern is the immediate equipping of the tool when the player joins, not subsequent equipping. We are investigating.

I am having an issue where I am calling :EquipTool after cloning a tool to the backpack. But when a player un-equips and re-equips the tool, the tool subsequently will unweld from the character and fall through the map (on the server) but locally it looks fine until then. This results in the tool being destroyed.

In this scenario, I am cloning and running :EquipTool in a server script.

Not sure if this is related, but it is definitely an issue I’ve been having.

1 Like