Hi, I would like to know if there is a way to get the current position of a part and use it to change the position relative to where it is. I am trying to make a Minecraft Dragon Egg and it needs to subtract a value from where it is in the present.
--minecraft dragon egg
bounce = true
function teleportEgg()
if bounce == true then
bounce = false
x = math.random(1, 20)
y = math.random(1, 20)
z = math.random(1, 20)
script.Parent.Position = Vector3.new(currentposition - x, currentposition - y, currentposition - z)
end
end
script.Parent.ClickDetector.Mouseclick:Connect(teleportEgg)

2 comments
wait, what is current position for? that would not work because it is not a variable?
It should work as long as the variable is script.Parent.Position. If it's not, then I changed my answer to include it. Also you should use local variables more often