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

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by
174gb 290 Moderation Voter
4 years ago
--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)

Ad

Answer this question