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
1 | local tridentc = trident:Clone() |
2 | tridentc.Parent = player.Backpack |
3 | tridentc.Name = "Trident1" |
4 | 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?
The issue you are having is that you're trying to use a . instead of a :
Therefore what you should do is
1 | local clone = trident:Clone() |
2 |
3 | clone.Name = 'Trident1' |
4 |
5 | clone.Parent = player.Backpack |
6 |
7 | 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 :)
To get your results, you could clone the tool under the player's character. It would look something like this.
1 | local tridentc = trident:Clone() |
2 | tridentc.Parent = player.Character --I changed the "Backpack" to "Character" so it will equip the tool |
3 | tridentc.Name = "Trident1" |
I hope this was helpful. If you need further help regarding this topic, feel free to comment on my post.