Quilcy
(Nogo)
April 2, 2020, 1:49pm
#1
This is what my script has:
1| wait(10)
2| workspace.test_part.Destroy()
All I want to know is how can I make this script destroy “test_part”. (which is one of the parts in the game)
Here’s a screenshot I took of the errors it gave me that I thought I could understand:
So, when using the Instance destroy, you need to use :
instead of .
so here’s your script:
local TestPart = --Your test Part
wait(10)
TestPart:Destroy()
1 Like
PurpalRBX
(PurpalRBX)
April 2, 2020, 1:52pm
#3
Try
wait(10)
workspace.test_part:Destroy()
You used “.Destroy()” instead of “:Destroy()”
Simply, use this:
wait(10)
workspace.test_part:Destroy()
when you call a function you need to use : no .
Quilcy
(Nogo)
April 2, 2020, 1:53pm
#5
Thanks all! I’m just going to make the first post the solution since they replied first.
Thanks!
colbert2677
(ImagineerColbert)
April 2, 2020, 8:02pm
#6
For the sake of knowledge: this is per the colon passing self as the implicit first argument. If you were calling it with a dot, it would be workspace.test_part.Destroy(workspace.test_part)
. The colon gets rid of the need to write out the object twice so the method just gets called on itself. Destroy is a member of the Instance superclass.
Quilcy
(Nogo)
April 2, 2020, 8:24pm
#7
Thanks a lot for explaining the difference between a peroid and a colon! Very very very appreciated by me! ^^