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

my script to disable another script isn't working at all. Does anyone know how I could resolve this?

Asked by 4 years ago
Edited 4 years ago

so i have a script set up to disable another script if a player who clicks a button has a certain tool in their backpack. it's not working at all so if you have any solution to this please let me know. i left the script below:

script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local Backpack = player:WaitForChild("Backpack")
local FindTool = Backpack:FindFirstChild("ClassicSword")
if FindTool then
         script.Parent.Main.Disabled = true
    else
    script.Parent.Main.Disabled = false
end

Answer this question