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

[ANSWERED]How do I get the scripts inside my tool to only stay active if the tool is equipped?

Asked by 3 years ago
Edited 3 years ago

I've used already used this method that I though would work: local tool = script.Parent

tool.Moves.Disabled = true

tool.Equipped:Connect(function() tool.Moves.Disabled = false end)

tool.Unequipped:Connect(function() tool.Moves.Disabled = true end)

And the Output just says that Moves is not a valid member of Tool, but it is a Child of Tool.

0
maybe trying tool:FindFirstChild("Moves") ? Jakob_Cashy 79 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Try this!



local tool = script.Parent local Moves = tool:FindFirstChild("Moves") tool.Moves.Disabled = true tool.Equipped:Connect(function() tool.Moves.Enabled= false end) tool.Unequipped:Connect(function() tool.Moves.Enabled= true end

i didn't Test it so tell me what it says in output, reply please

0
After looking over your Answer I was able to come up with a working method which is the same as yours but its a tiny bit different AuraBeast1 8 — 3y
0
Its not tool.Equipped:Connect(function() tool.Moves.Enabled = true its Its not tool.Equipped:Connect(function() tool.Moves.Disabled = false and so is the other line of code for the Unequipped function. Anyway thx so much for helping me! AuraBeast1 8 — 3y
0
I made some spelling errors so i will type it in again (sorry if its annoying) AuraBeast1 8 — 3y
0
Its not tool.Equipped:Connect(function() tool.Moves.Enabled = true its tool.Equipped:Connect(function() tool.Moves.Disabled = false and so is the other line of code for the Unequipped function. Anyway thx so much for helping me! AuraBeast1 8 — 3y
0
np! BrishedBoomer 29 — 3y
Ad

Answer this question