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)
it is easy. just do this,
copy this script to the moving part inside the tool. so script.Parent is the moving part in that tool. when it touches something, do that onHit() thing!
but then, you need to fix something. model is, of course, not a script.parent.parent anymore, it has to be derived from workspace.