I had this issue where I tried to parent the tool to the character on the server. I used a proximity prompt and everything seemed to work except when the tool is parented to the character. There were no errors though. (I want the tool to be parented to the character so that the tool instantly equips)
When the print line executed, it says that the tool was parented to the character, and it is on the server, but locally I still saw it as a parent of the workspace. Also, the tool’s equipped event didn’t fire on the client. Both scripts are parented to the tool.
Note: “equipGun” is the proximity prompt and “gun” is the tool
equipGun.Triggered:Connect(function(player)
local character = player.Character or player.CharacterAdded:wait()
if character then
equipGun.Enabled = false
gun.Parent = character
print("parented ", gun.Parent)
end
end)
However, if I parent the tool to the player’s backpack it will replicate and work properly.
equipGun.Triggered:Connect(function(player)
if player.Backpack then
equipGun.Enabled = false
gun.Parent = player.Backpack
print("parented ", gun.Parent)
end
end)
I already found the solution to what I wanted to achieve
I figured out I was improperly trying to make the character equip the tool. I found a solution and used Humanoid:EquipTool, and it looks like I needed to put the tool inside of the player’s backpack before trying to do anything with it. The code segment above and the solution with Humanoid:EquipTool both printed the gun’s parent as the backpack, so I guess there’s that.
But, I still don’t know if what I initially had was expected or a bug (I can’t post in bug reports), so any help is appreciated!