I made a car spawner but the tutorial taught me to make the car spawner button have to be stepped or walked over in order to respawn the car. I would like to change it so that it has to be clicked on. Thank you. The bottom of the script is the part that I need to know how to change. Also do I need to use the ClickDetector?
Here is my script:
model = script.Parent.Parent--Indicates that the script interacts with the model the button is grouped with. messageText = ""--If you want a message to appear upon pressing, type it here.
message = Instance.new("Message") message.Text = messageText backup = model:clone() enabled = true
function regenerate() message.Parent = game.Workspace model:remove()
wait(0)--Change this number to display the regen message as long as you want in seconds.
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil
script.Disabled = true
script.Parent.BrickColor = BrickColor.new(26)--Black
wait(5)--Change this number to change the time in between regenerations via the button, in seconds..
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)

2 comments
So do I remove the script I showed you in my description and replace it with the script that you say is better?
I didn't give you a script, I just told you how to use the event. You can modify the script that you have to work with a mouseclick event.