i made this script awhile ago which regenerates a part when this part is touched by a player. is it possible to make two parts and if the ball touches any of those it regenerates?
local model = game.Workspace.b
local message = Instance.new("Message")
message.Text = ""..model.Name
local backup = model:clone()
local regenerating = false
function regenerate()
--Don't regenerate again if we're already doing it!
if regenerating then
return
else
regenerating = true
end
model:remove()
-- Display the regen message for .7 seconds
message.Parent = nil
wait(0)
message.Parent = nil
-- Put the copied model back into workspace
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
-- After 20 seconds, allow the model to be regenerated again
wait(20)
regenerating = false
end
--Connect a function that regenerates the model when a player touches the button
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
regenerate()
end
end)
do you know a place where people can give scripts? i have a scripter but our timezones are different so he comes at night. so in the day i try to do stuff myself so i use devofrum