ive been trying to model the solar system, however i cant get a planet orbit another
--[[
_G.mercx is 100, mercz is 0
]]
xris = false
zris = false
while wait(.05) do
if _G.mercx >= -100 and xris == false then
_G.mercx = _G.mercx - 1
elseif _G.mercx <= -100 and xris == false then
xris = true
elseif _G.mercx < 100 and xris == true then
_G.mercx = _G.mercx + 1
elseif _G.mercx == 100 and xris == true then
xris = false
end
if _G.mercz > -100 and zris == false then
_G.mercz = _G.mercz - 1
elseif _G.mercz == -100 and zris == false then
zris = true
elseif _G.mercz <= 100 and zris == true then
_G.mercz = _G.mercz + 1
elseif _G.mercz > 100 and zris == true then
zris = false
end
script.Parent.Velocity = Vector3.new(_G.mercx, 0, _G.mercz)
end
--merc is short of mercury, that i am trying to model
its rather an oval than a circle, and not even repeating
