Hi everyone! I currently have been trying to implement a dual-wielding tool system that would enable my players to have particles and/or trails come out of their hands. Following a youtube tutorial, I was able to garner a script that allowed a single player to equip the tools correctly but when two (or more) players equip them at the same time it results in the two player characters glitching inside of each other like so:
You aren’t cloning your tool, so only one exists. I’ve also cleaned up your code a bit. Please never use such short abbreviations. It’s super hard to do later down the road.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Equipt = ReplicatedStorage:WaitForChild("EquipT")
local UnEquipt = ReplicatedStorage:WaitForChild("UnequipT")
Equipt.OnServerEvent:Connect(function(player)
local character = player.Character
local Handle = script.Parent.Parent.RHandle:Clone()
local Handle2 = script.Parent.Parent.LHandle:Clone()
local RightHand = character:WaitForChild("RightHand")
local LeftHand= character:WaitForChild("LeftHand")
local weld = Instance.new("Weld", Handle)
weld.Part0 = RightHand
weld.Part1 = Handle
local weld2 = Instance.new("Weld", Handle2)
weld2.Part0 = LeftHand
weld2.Part1 = Handle2
end)
This unfortunately did not work. When this is put in place of the original script the tool appears in the inventory for a short time, doesn’t seem to weld correctly, and then disappears out of the inventory.
No errors (related to the tool) are given. The tool successfully appears in the inventory, however when equippped no particles are emit from the hands (like it is meant to, likely b/c of welds not working.) After a few seconds of being equipped, the tool disappears from the inventory. For reference, here is the tool hierarchy:
The LocalScript parent of the actual script is simple, just establishing the events:
local Equipt = rs:WaitForChild("EquipT")
local UnEquipt = rs:WaitForChild("UnequipT")
local tool = script.Parent
tool.Equipped:Connect(function()
Equipt:FireServer()
tool.Unequipped:Connect(function()
UnEquipt:FireServer()
end)
end)
Thank you for this, but would you actually mind wrapping it into a file and sending it? I’m struggling to figure this out myself over the devforum. If you aren’t comfortable with that, or want to remove a script or something else, that is completely fine!