Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- NEVS STEPS TO ORBITAL SUCCESS:
- -- 1. COPY/PASTE INTO THE SUN (OR PLANET BRICK IF YOU'RE MAKING A MOON ORBIT)
- -- 2. CLICK ON THE FIRST PLANET MODEL THAT WILL BE ORBITING THE SUN (OR THE MOONS MODEL)
- -- 3. SET THE PRIMARYPART PROPERTY OF THAT MODEL TO THE PLANET BRICK INSIDE THE MODEL
- -- 4. CHANGE THE VALUE OF "local orbiter" IN THIS SCRIPT TO game.Workspace["THE EXACT NAME OF THE PLANETS MODEL INCLUDING SPACES"]
- -- 5. ADJUST "local repeatTime, local distance, local update" TO MEET YOUR PARAMETERS. REMEMBER THAT THE LOWER THE VALUE OF "repeatTime" IS, THE MORE LAG THERE WILL BE.
- local ang = 0 --Declaring the starting angle, no need to change this.
- local origin = script.Parent --This is what the orbiter orbits around
- local orbiter = game.Workspace["Terran 2"] --Make sure this is set to a Model and make sure the Model has a Primary Part set.
- --The primary part will be the origin point
- local repeatTime = .1 --The amount of time it will take before each run
- local distance = 2000 --How far the orbiter is away from the origin
- local update = .0001 --How far the orbiter moves per run
- while wait(repeatTime) do
- print("A")
- local newA = origin.CFrame * CFrame.fromEulerAnglesXYZ(0,ang,0) * CFrame.new(0,0,(origin.Size.Z/2 + origin.Size.X/2) + distance)
- orbiter:SetPrimaryPartCFrame(CFrame.new(newA.x,newA.y,newA.z))
- ang = ang + update
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement