Can you help me? When a user throws a ball at a dunk tank, what is the script to reset the dunk tank?
What is a script to restart an action?
1 answer
I do not know what the object being dunked is. I will assume it's a part called "Partt" (Creative right?).
So, there are multiple way to do this but assuming you do not understand the scripting of your dunk tank because it is not yours, I will show you another way. This way is very simple and we will be using the touched event.
I will describe how I view the hierarchy here because you do not show where things are located so just check my code and this description. I am assuming their is a regular part that will be dunked and that part is named Partt and its inside of the model Dunking Tank. I assume to find the tank, you would go Workspace to a model named Dunking Tank that has all its parts inside and one of those parts are called water, where the object falls and ends up touching. This script will also be located in Water. Now for what you care about, the scripting!
- The scripting
db = false
script.Parent.Touched:connect(function(hit)
if db == false then db = true
if hit.Name == "Partt" then
wait(5) -- will not spawn until 5 seconds are up
script.Parent.Parent.Part
local copy = game.ServerStorage.Partt:Clone()
copy.Parent = script.Parent.Parent
copy.CFrame = CFrame.new(0,5,0)
end
end
db = false
end)
- script information All the above script is doing is using a denounce so it activates once and you need a copy of the falling part in ServerStorage. The script removes the fallen part and clones a copy of it to the workspace then moved to position 0,5,0. You must change where the part appears and you can take the CFrame of a part in the model and add to the y axis or any. Such as the platform it falls off.
Hope this helps, I spent a long time on my iPod typing this
1 comment
Although you are helping people, I don't think having to help someone who didn't bother trying to show their script issue should be replied to.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Share more details please.
In part of a game, the user will throw a ball at a free model dunk tank, when they throw the ball and hit the target, what is a script to put the thing they dunked back on the platform?