I'm trying to fix something which is taking me ages, basically- I'm trying to make it so that a script of mine only works when I have a certain tool in my hand.
model = script.Parent.Parent
backup = model:clone()
enabled = true
function regenerate()
model:remove()
wait(1)--
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
script.Disabled = true
script.Parent.BrickColor = BrickColor.new(26)--Black
wait(1)
script.Parent.BrickColor = BrickColor.new(104)--Purple
script.Disabled = false
end
function onHit(hit)
if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
regenerate()
end
end
script.Parent.Touched:connect(onHit)

1 comment
(This script is supposed to regenerate a model when touching a part, it does that except I'm just trying to make it that it only regenerates when someone has a certain tool in their hand, and touches the brick that regenerates it.