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

How do I make a cannonball dissapear?

Asked by 6 years ago

I have a hand cannon that works fine, but when the cannonball hits something, it just creates an explosion and bounces off. The way it works is that every time the cannon fires, it fire a clone of the actual cannonball. So, how would I script the CLONE to disappear and not the cannonball itself when the clone collides with something.

2 answers

Log in to vote
0
Answered by 6 years ago

Well, I would use a BuiltInFunction. Like :remove()

ex.

local part = game.workspace.Part

wait(1)
part:Remove()

^^ Hope this helped.

-TheArcticTerminal

0
I get what you're saying, but how do I specify for it to remove the clone, not just a part. tygerupercut3 68 — 6y
0
Set a variable to the clone then attach the remove function to it. TheLightningRises 56 — 6y
0
":Remove()" was deprecated. Use ":Destroy()" as an alternative. Gey4Jesus69 2705 — 6y
0
Wow. Your method works, I believe. But my problem was that I was using a premed weapon with scripts and stuff and it already had a clone variable taken care of. I just had to change some names and add a :Destroy(). My bad, thanks for the help, I will use it in the future. tygerupercut3 68 — 6y
View all comments (2 more)
0
Thanks to Giono1 or me? TheLightningRises 56 — 6y
0
Thanks to Gion01 for the help and example and thanks to you for the extra tip with :Destroy() tygerupercut3 68 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

Eh, I Suggest changing your whole script to something based on rays with bullet drop and then add cannonball animation, since it is more convenient in every single way

Answer this question