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

how can i get position of part from script?

I have created script that changes anchor of part to false, and makes this part fall on floor. but, after 3 secounds i want same part to return to its defaut position.

i want script to check position of part before it falls on the ground, to make it return on its defaut position, but i dont know how to check position of part by using script.

-- not working script

local PartPosition = script.Parent.Position

script.Parent.Touched:Connect(function() wait(1) script.Parent.Anchored = false wait(3) script.Parent.Position = PartPosition

end)

And yeah, sorry for bad english

2 comments

0

i think it does but since the position youre giving to the part is the same because partposition is the position of the same part

0

btw. lines of code are placed correctly, website messed it up a little.

2 answers

i think it does but since the position youre giving to the part is the same because partposition is the position of the same part

do smth like local position = "original position of the part here"

script.Parent.Touched:Connect(function() wait(1) script.Parent.Anchored = false wait(3) script.Parent.Position = position

end)

1 comment

0

Thanks for help, works.

You Can Create A New Part With The Same Position As The Part Your Making It Fall. So Make Starter Position Invisible, Uncollidable And Anchored. And The Just Do This Code:

local StartPos = [your starter pos start namethingy]

script.Parent.Touched:Connect(function()
wait(1) 
script.Parent.Anchored = false
wait(3)
script.Parent.Position = StartPos

end)

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