Advertisement
THE17THSON

Solar System Script

Apr 2nd, 2021
2,112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.05 KB | None | 0 0
  1. -- It is good to know that this will slow your game loading by a significant amount. Try to use small scale planets...
  2. -- Add a "Script" to an object(Sun, Planet, whatever you want to be stationary)
  3. -- Paste the information below into that script, change values as you see fit. Keep in mind your workspace size...
  4.  
  5. local i = 0
  6. local speed = 0.009 -- You can edit this...However, the current speeds are relatively easy on system memory.
  7. local speed2 = 0.008
  8. local speed3 = 0.007
  9. local speed4 = 0.006
  10. local speed5 = 0.005
  11. local speed6 = 0.005
  12. local speed7 = 0.004
  13. local speed8 = 0.003
  14. local Moonspeed = 0.05
  15. local Mercury = game.Workspace.Mercury --Can change to a moon...or name of your choice...dog, cat, ball, spoon, torpedo.
  16. local Venus = game.Workspace.Venus
  17. local Earth = game.Workspace.Earth
  18. local Moon = game.Workspace.Moon
  19. local Mars = game.Workspace.Mars
  20. local Jupiter = game.Workspace.Jupiter
  21. local Saturn = game.Workspace.Saturn
  22. local Uranus = game.Workspace.Uranus
  23. local Neptune = game.Workspace.Neptune
  24. local Sun = game.Workspace.Sun -- Can change to a planet...or name of your choosing...tree, shovel, grandma's house.
  25. local Mercurydistance = 200 --Distance between sun & mercury
  26. local Venusdistance = 400 --Distance between sun & venus
  27. local Earthdistance = 600 --Distance between sun & earth
  28. local Moondistance = 75 --Distance between earth & moon
  29. local Marsdistance = 1000 --Distance between sun & mars
  30. local Jupiterdistance = 1500 --Distance between sun & jupiter
  31. local Saturndistance = 2250 --Distance between sun & saturn
  32. local Uranusdistance = 3000 --Distance between sun & uranus
  33. local Neptunedistance = 3750 --Distance between sun & neptune
  34.  
  35.  
  36.  
  37. while true do
  38.  
  39.     wait()
  40.     i = i + 1
  41.     local incline = math.rad(0) --The angle at which the object orbits
  42.     local incline2 = math.rad(0)
  43.     local incline3 = math.rad(0)
  44.     local incline4 = math.rad(0)
  45.     local incline5 = math.rad(0)
  46.     local incline6 = math.rad(0)
  47.     local incline7 = math.rad(0)
  48.     local incline8 = math.rad(0)
  49.     local Moonincline = math.rad(90)
  50.  
  51.     Mercury.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline, i * speed, 0) * CFrame.new(0, 0, Mercurydistance)
  52.     Venus.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline2, i * speed2, 0) * CFrame.new(0, 0, Venusdistance)
  53.     Earth.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline3, i * speed3, 0) * CFrame.new(0, 0, Earthdistance)
  54.     Moon.CFrame = Earth.CFrame * CFrame.fromEulerAnglesXYZ(Moonincline, i * Moonspeed, 0) * CFrame.new(0, 0, Moondistance)
  55.     Mars.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline4, i * speed4, 0) * CFrame.new(0, 0, Marsdistance)
  56.     Jupiter.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline5, i * speed5, 0) * CFrame.new(0, 0, Jupiterdistance)
  57.     Saturn.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline6, i * speed6, 0) * CFrame.new(0, 0, Saturndistance)
  58.     Uranus.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline7, i * speed7, 0) * CFrame.new(0, 0, Uranusdistance)
  59.     Neptune.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(incline8, i * speed8, 0) * CFrame.new(0, 0, Neptunedistance)
  60.  
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement