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

Is this the correct way to use built in functions?[SOLVED ON ANOTHER POST]

Asked by 4 years ago
Edited 4 years ago

Hello Fellow Scripters! So this is what I am trying to make: First, you wait 3 seconds then a part will be cloned at this position; (60, 34, 59), and a message will be printed into the output. After that you will wait 5 seconds and the cloned part will be destroyed. Then, some text will be printed again 4 seconds the part was destroyed. Please correct me if I am incorrect! Thanks!

My Code:

wait(3)

local myClone = game.Workspace.Part:Clone()
myClone.Position = (60, 34, 59)

print(The Part has been cloned.)

wait(5)

myClone:Destroy()

wait(4)

print(HAHA That part has been deleted!)
--This should work right?
--Answer if you the answer to this question.

Question(s): On line 3 when we used a variable to define the cloned part, on line number 10 do we still have to call the part "myClone"???

Please do not forget to answer both questions above.

Well thanks for helping. :D

Correct Answered code a fellow scripter helped with:


wait(3) local myClone = game.Workspace.Part:Clone() myClone.Position = Vector3.new(60, 34, 59) print("The Part has been cloned.") wait(5) myClone:Destroy() wait(4) print("HAHA That part has been deleted!") --This should work right? --Answer if you the answer to this question.

1 answer

Log in to vote
0
Answered by
0Vyp 14
4 years ago
Edited 4 years ago

Hello there, yes that is the correct way of doing it. Yes you will need to call the myClone part on line 10. I would also put "" on your prints, Heres the edited script:

wait(3)

local myClone = game.Workspace.Part:Clone()
myClone.Position = Vector3.new(60, 34, 59)

print("The Part has been cloned.")

wait(5)

myClone:Destroy()

wait(4)

print("HAHA That part has been deleted!")
--This should work right?
--Answer if you the answer to this question.
0
Thank you very much. It usually takes a long time to get an answer! dabberbestleader 14 — 4y
0
Not a problem! Glad to help. 0Vyp 14 — 4y
0
You should be casting a Vector3 to the position property... Ziffixture 6913 — 4y
0
He is correct, just edited the script. Completely forgot about that part. 0Vyp 14 — 4y
View all comments (2 more)
0
OOF! Well thanks to Ziffixture AND 0Vyp!!! dabberbestleader 14 — 4y
0
UH, I didn't work... dabberbestleader 14 — 4y
Ad

Answer this question