local function OnClicked() script.Parent:Remove() end parent.ClickDetector.MouseClick:connect(OnClicked)
I'm not the best scripter but would like to try scripting as it is a good skill to have along with building which I can build great enough now. But I can't find out how to make it where you get the darn bullet to disapear when u click on it. I already have a click detector and all but it still wont seem to work. I have a feeling I'm stuck using older code i knew back in the day but dont know how to do newer code. Any suggestions?
:Remove()
is deprecated.
Instead you can use
script.Parent:Destroy()
(method destroys it completely)
or
game:GetService("Debris"):AddItem(script.Parent, 0)
(don't use this unless you want to make it yield or wait until it can be destroyed, 0 is the amount of seconds until the item is removed.)
Also, like the previous answer, it is highly recommended to indent your code. This makes it easier to understand and can help you organize code better.
local function OnClicked() script.Parent:Destroy() end script.Parent.ClickDetector.MouseClick:connect(OnClicked)
Also, please indent your function's body, it makes it much easier to read.