Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to save original position of an object?

i am trying to make a knocking down and regenerating street lamp

here is the script

script.Parent.Position.X = script.Parent.originalPos.Value.X
wait(0.1)
script.Parent.Position.Y = script.Parent.originalPos.Value.Y
wait(0.1)
script.Parent.Position.Z = script.Parent.originalPos.Value.X

also if you want to

can you possibly make so i don't have to spam the xyz thing

also this script doesn't work down here it just puts the part to 0,0,0

script.Parent.Position = script.Parent.originalPos.Value
wait(0.1)
script.Parent.Position = script.Parent.originalPos.Value
wait(0.1)
script.Parent.Position = script.Parent.originalPos.Value

2 answers

Make an int value under the lamp and copy and paste its position in there.

3 comments

0

pro

0

why not make a variable in the beginning of the script with the Vector3? local Originalpos = object.Position and when you want to put it back object.Position = Originalpos

0

i figured it out i just needed to turn it around

i figured it out i just needed to turn it around

it needed to be

script.Parent.originalPos.Value = script.Parent.Position

This discussion is preserved as it was. New answers, comments, and votes are closed.