Applying a script to multiple blocks

How do I make this work with multiple parts called SuperVisionBlock

– variables

local tool = script.Parent
local handle = script.Parent:WaitForChild(‘Handle’)
local localplayer = game.Players.LocalPlayer
local supervision = workspace:GetChildren(‘SuperVisionBlock’)

– equiped

tool.Equipped:connect(function()
for i,v in pairs(game.Workspace:GetAllChildren()) do
if v.Name == “SuperVisionBlock” then
supervision.Transparency = 0
localplayer.Character.Humanoid.WalkSpeed = 0
localplayer.Character.Humanoid.JumpPower = 0
end
end
end)

– unequipped

tool.Unequipped:connect(function()
for i,v in pairs(game.Workspace:GetAllChildren()) do
if v.Name == “SuperVisionBlock” then
supervision.Transparency = 1
localplayer.Character.Humanoid.WalkSpeed = 16
localplayer.Character.Humanoid.JumpPower = 50
end
end
end)

Please continue your discussion here if possible:
https://devforum.roblox.com/t/how-would-i-make-this-tool/72383

Since it already has a description of the problem you’re trying to solve, it’s better to continue talking there. :slight_smile: