I am making a script that when something hits a player, it flies their 'wand' to the other players hand. The only error is that when it takes the tool out of the players hand, the player re-picks it up and it doesn't move. Is there a way I can make it not be able to be picked up so the person that got hit won't pick it up while it flies away? This is the script:
dont mind how messy it is if there are any ends missing dw about it because its a snippet
TLDR: once hit with spell, flies wand from victim(person that got hit) to caster (person that hit the victim). the error is that once the wand flies from the victims hand, they re-pick it up and it stays still. it would dis-equip to fly to the caster but then the victim will pick it up again. How do I fix this and make the wand not be able to be picked up for like a second?
orbb = game.Players:GetPlayerFromCharacter(hit.Parent) print(hit.Parent.Name .. "is the best XD!") orbbb = hit.Parent.Name print(orbbb.. " is who was hit by expell") Orb = game.Workspace:FindFirstChild(orbbb).Wand.Handle orbbbbb = game.Workspace:FindFirstChild(orbbb).Wand orbbbbb.Handle.Position = orbbbbb.Handle.Position + Vector3.new(10,5,0) orbbbbb.Parent = workspace orbbbbb.Handle.Position = orbbbbb.Handle.Position + Vector3.new(10,5,0) Orb.Anchored = false local BodyPosition = Instance.new("BodyPosition", Orb) while wait(0) do if orbbbbb.Parent == workspace then orbbbbb.Handle.Position = orbbbbb.Handle.Position + Vector3.new(10,5,0) BodyPosition.Position = game.Workspace:FindFirstChild(name):FindFirstChild("Right Arm").CFrame:pointToWorldSpace(Vector3.new(0, 0, 0)) else BodyPosition:Destroy() end
When the tool flies from the character, rename the handle to something other than 'Handle'. This will work because the Handle is what allows you to pick up a tool in the first place. Then, after you wait a moment, rename the handle and then you can pick it up again. Good luck!