Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Humanoid.EquipTool is not working in a local script?

Asked by 5 years ago
Edited 5 years ago

Hello, I am trying to make a script were a player can equip a trident, but its not working, here is the code that the error is from

            local tridentc = trident:Clone()
            tridentc.Parent = player.Backpack
            tridentc.Name = "Trident1"
            character.Humanoid.EquipTool(tridentc)

I keep on getting an error that says

** 2:07:21.324 - The function EquipTool is not a member of "Tool" **

what did I do wrong?

2 answers

Log in to vote
1
Answered by
IDKBlox 349 Moderation Voter
5 years ago

The issue you are having is that you're trying to use a . instead of a :

Therefore what you should do is

local clone = trident:Clone()

clone.Name = 'Trident1'

clone.Parent = player.Backpack

character.Humanoid:EquipTool(clone)

This should work perfectly now. But I should add Mc3334 is correct, if you'd like it to just be automatically equipped. Setting the clones parent to the player.Character may be a bit more beneficial.

But yeah that was your issue :)

0
Thanks for the help turbomegapower12345 48 — 5y
0
No problem! glad I could help! IDKBlox 349 — 5y
Ad
Log in to vote
2
Answered by
mc3334 649 Moderation Voter
5 years ago
Edited 5 years ago

To get your results, you could clone the tool under the player's character. It would look something like this.

local tridentc = trident:Clone()
tridentc.Parent = player.Character --I changed the "Backpack" to "Character" so it will equip the tool
tridentc.Name = "Trident1"

I hope this was helpful. If you need further help regarding this topic, feel free to comment on my post.

0
Hello thanks for helping out, but the trident spawns only in the middle of the baseplate, when I parent the trident clone to character? turbomegapower12345 48 — 5y

Answer this question