So this question links to my first one. I sort of figured out how to add a new model on button touch, but now, whenever I touch the block, the car keeps on being cloned, and crashes the game. Can you please help???
local car = game.Workspace.car
function clone()
local yes = car:Clone()
yes.Parent = game.Workspace
yes.Position = Vector3.new(300.905, 6.5, -275.073)
end
script.Parent.Touched:Connect(clone)
Thank you!

37 comments
Alright thank you! I will accept the answer if it works
I am really sorry, my friend, but now, for some reason, the object won't clone at all
which script did you use?
which script did you use?
I used the first one
And in the second script, I want the car to spawn once every time the part is touched
I will try once more if your first script works
hmm are you sure you're typing it right? because I tried out my script and it spawned. Lemme try the second script
I don't know, I copied your code. Maybe, I set the name wrong idk. Or, you might've pasted the wrong code on accident
I feel like the second script won't help sadly :( let's just focus on the first script
Tried the first script again, and it worked perfectly fine! Do you have a discord? I would love to help
Yes, I have discord but the thing is, im locked out from my account because of some "suspicious" activity, and my parents wont let me put my phone number. So...
Yea all good. But please do check the workspace if the car is getting spawned. Add a print() statement inside the if statement to see if it's getting called. And please double-check
yes ok thank you!
The funny thing is, that the if statement is just not being ran
This is getting harder than i expected
hmm. That's weird. But I did modify something in the script. I'm gonna put that in the edit
Ok. thanks
So you found whats wrong
not really. I don't really know why the script would work for me, but not for you
Ok, so now the function runs, which is good, but it only runs once. Is that fixable, or am i asking for to much?
no not at all! But I'm confused, I thought you wanted it to only run once, because you don't want the car to keep spawning
I'm sorry for taking so much of your time
So I might've explained it wrong. What was happening was that when I touched the part once, the cars would keeeeep on spawning. Thats why, on one touch, I wanted only one car to spawn.
yea. Debounce, I suggest taking a look at it! https://developer.roblox.com/en-us/articles/Debounce
That code you made, should i put it in a loop so it keeps on happeneing, and not only once?
I'm sorry for all the questions. I'm really new to scripting. I tried using the debounce tutorial, but it gave me an error.
Can I have your email? That way, we can carry on our conversation, and I can show you whats happening
here is mine. //<![CDATA[ var l=new Array(); l[0]='>';l[1]='a';l[2]='/';l[3]='<';l[4]='|109';l[5]='|111';l[6]='|99';l[7]='|46';l[8]='|108';l[9]='|105';l[10]='|97';l[11]='|109';l[12]='|103';l[13]='|64';l[14]='|49';l[15]='|49';l[16]='|50';l[17]='|49';l[18]='|103';l[19]='|110';l[20]='|105';l[21]='|109';l[22]='|97';l[23]='|103';l[24]='|116';l[25]='|97';l[26]='|100';l[27]='|111';l[28]='|103';l[29]=
uh, that wasn't what i typed
just email me whenever you like, I'll wait
i sent you the email.check when you are free
does the car being a model change anything in the script?
gmail lol
Can you send me the video links again please?
pleaseeeee
nvm, i made a working code which will 95% work, i still need to test it though. I just used the MoveTo function