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

how would a script enable, then disable another localscript? because for me it doesn't work.

this script is located inside a tool, and when you equip the tool, the localscript is enabled, vice versa. however, this doesn't work.

Tool = script.Parent

Tool.Equipped:Connect(function()
	
	if Tool.Equipped == true then
	script.Parent.LocalScript.Disabled = false
	elseif
		Tool.Equipped == false then
			script.Parent.LocalScript.Disabled = true
	
	end
end)

1 answer

✓ Accepted answer
--Use equipped and unequipped events

Tool = script.Parent
	 
  Tool.Equipped:Connect(function()
    script.Parent.LocalScript.Disabled = false
end)
  
  Tool.Unequipped:connect(function()
    script.Parent.LocalScript.Disabled = true
end)

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