Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I can't get my script to delete a part, and spawn another, can anyone help?

Asked by 9 years ago

I am trying to make a script where a part, which has a value in it, goes into a tunnel gets deleted and another part spawns, it doesn't seem to work, and I can't tell why it won't. Can anyone tell me what I am doing wrong?


function mold() local part = script.Parent.Candy:Clone() part.Parent = game.Workspace part.Anchored = false part.Transparency = 0 end function Delete(cat) if cat:FindFirstChild("Value") then cat:Destroy() mold() end end script.Parent.Molder.Touched:connect(Delete()) ``
1
You do not need the extra parenthesis on "Delete" in your connection line. M39a9am3R 3210 — 9y
0
On line 8, you have the argument/parameter 'cat'. In the terms you're using it, you're using it incorrectly. I recommend defining the variable cat within the function, and deleting the argument Shawnyg 4330 — 9y

Answer this question