Problem Description
I’m experiencing an issue with Tool Equipped
and Unequipped
events not firing consistently in my game. The events work fine initially, but after certain interactions (specifically when using a ProximityPrompt with the “G” key) when I’m buying from the shop the Sword holder placement system placeholder is working perfectly fine which is not the case with the ProximityPrompt, the events stop triggering altogether.
Expected Behavior
- When a player equips a tool, the
Equipped
event should fire - When a player unequips a tool, the
Unequipped
event should fire - This should happen every time, regardless of how the tool was obtained
Current Behavior
- Events work correctly on first tool usage
- After using ProximityPrompt with “G” key, subsequent tool equips/unequips don’t trigger the events
- The tool appears in the player’s hand visually, but the events are silent
Code Structure
ProximityPrompt Handler (Server)
lua
ProximityPrompt.Triggered:Connect(function(playerWhoTriggered)
if Owner.Value == playerWhoTriggered then
local RackService = cachedModules.Cache.RackService
local InventoryService = cachedModules.Cache.InventoryService
local DataService = cachedModules.Cache.DataService
local cosmeticService = cachedModules.Cache.CosmeticShopService
local playerData = DataService.getData(playerWhoTriggered)
local playerPlotOwned = playerWhoTriggered:FindFirstChild("PlotOwned").Value
local IsForgingSword = playerPlotOwned:GetAttribute("IsForgingSword")
if ProximityPrompt.KeyboardKeyCode.Name == "G" and not IsForgingSword and playerData.CurHolder > 1 then
if CurSword == 0 then
local Name = Object.Name
cosmeticService.giveCosmetic(playerWhoTriggered, Name, 1)
Object:Destroy()
end
else
TriggerSound:FireClient(playerWhoTriggered, "Error")
end
end
end)
Tool Creation & Event Binding (Server)
local toolClone = isHolder:Clone()
toolClone.Parent = player.Character
toolClone.Name = upgradeDataModule[toolName].Name
toolClone:SetAttribute("Name", upgradeDataModule[toolName].Name)
print("TOOL CLONE IS : ", toolClone.Name)
print("TOOL INSTANCE IS A TOOL IS : ", toolClone:IsA("Tool"))
toolClone.Equipped:Connect(function()
print("EQUIPPED HOLDER")
for _, part in ipairs(toolClone:GetDescendants()) do
if part:IsA("BasePart") then
part.Transparency = 1
end
end
if toolClone.Name:find("Crate") then
print("NEXT ID CRATE OF PLAYER SHOULD BE : ", player:WaitForChild("CrateCount").Value + 1)
ActivatePlacement:FireClient(player, toolName, true, true, player:WaitForChild("CrateCount").Value + 1)
elseif toolClone.Name:find("Sword holder") then
print("NEXT ID HOLDER OF PLAYER SHOULD BE : ", player:WaitForChild("HolderCount").Value + 1)
ActivatePlacement:FireClient(player, toolName, true, true, player:WaitForChild("HolderCount").Value + 1)
end
end)
toolClone.Unequipped:Connect(function()
print("UNEQUIPPED HOLDER")
if toolClone.Name:find("Crate") then
print("NEXT ID CRATE OF PLAYER SHOULD BE : ", player:WaitForChild("CrateCount").Value + 1)
ActivatePlacement:FireClient(player, toolName, false, true, player:WaitForChild("CrateCount").Value + 1)
elseif toolClone.Name:find("Sword holder") then
print("NEXT ID HOLDER OF PLAYER SHOULD BE : ", player:WaitForChild("HolderCount").Value + 1)
ActivatePlacement:FireClient(player, toolName, false, true, player:WaitForChild("HolderCount").Value + 1)
end
end)
Console Output Example
I will include a screenshot of my console showing that the “EQUIPPED HOLDER” and “UNEQUIPPED HOLDER” prints are missing after using the ProximityPrompt
What I’ve Tried
- Verified that
toolClone:IsA("Tool")
returnstrue
- Added debug prints to confirm tool creation
- Checked that the tool is properly parented to
player.Character
- Confirmed the issue only occurs after using the “G” key ProximityPrompt
Questions
- Could the
Object:Destroy()
call in the ProximityPrompt be affecting subsequent tool instances? - Are there any known issues with Tool events after certain server operations?
- Should I be connecting these events differently for server-created tools?
- Is there a way to “refresh” or re-establish event connections?
Environment
- This is happening on the server side
- Tools are created via
Clone()
from ServerStorage - Issue is reproducible 100% of the time after using the ProximityPrompt
Any help or insights would be greatly appreciated! The tools appear and function visually, but the critical Equipped/Unequipped events are essential for my game’s placement system.