Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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.

1 comment

0

maybe trying tool:FindFirstChild("Moves") ?

1 answer

✓ Accepted answer

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

5 comments

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

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!

0

I made some spelling errors so i will type it in again (sorry if its annoying)

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!

0

np!

This discussion is preserved as it was. New answers, comments, and votes are closed.