Hey i think i have fixed your problem.
First we will need a variable for the player: (make sure this is a Local Script)
1 | local player = game.Players.LocalPlayer |
Now we can do the full code!
First lets see the code you alredy have:
01 | local examplePart = game.Workspace.examplePart |
02 | local exampleTool = player.Backpack.ThisIsExample 1 |
03 | local exampleToolA = player.ReplicatedStorage.ThisIsExample 2 |
06 | examplePart.Touched:Connect(onTouch) |
07 | exampleToolA.Parent.Equipped:connect( function () |
08 | print (omg its equipped lol) |
09 | exampleTool.Parent.Unequipped:connect( function () |
10 | print (omg its unequipped lol) |
Ok now its the part where the magic happends.
There's a way that you can force the tool equipment, its using Humanoid:EquipTool
So your script should look like this:
01 | local player = game.Player.LocalPlayer |
03 | examplePart.Touched:Connect(onTouch) |
04 | Humanoid:EquipTool(exampleTool) |
06 | exampleToolA.Parent.Equipped:connect( function () |
07 | print (omg its equipped lol) |
09 | exampleTool.Parent.Unequipped:connect( function () |
10 | print (omg its unequipped lol) |
Unfortunatly idk if there's a way to unequip a tool using a script :/
For more information about this subject, check this article
I hope this works for you, if it doesn't send me a message!
(also if i spelled something wrong correct me, im portguese sry :/)
(and also im noob at scripting so it very probable that this doesn't work, but good luck)