Hello! I am writing a simple star system generator. All was working well until I tried to put the orbiting script onto the planets. It works once but it does not clone the orbit script!
Here is my code:
local atrribute = game.Workspace.CreationPropertiesHandlers.PlanetCreationHandler
local Colour = atrribute:GetAttribute("Colour")
local Size = atrribute:GetAttribute("Size")
local HasAtmosphere = atrribute:GetAttribute("HasAtmosphere")
local OrbitRadius = atrribute:GetAttribute("OrbitRadius")
local OrbitSpeed = atrribute:GetAttribute("OrbitSpeed")
local Planets = atrribute:GetAttribute("Planets")
for i = 1, Planets do
Part = Instance.new("Part")
Part.Parent = workspace
Part.Name = "Planet" .. i
Part.Anchored = true
game.ServerStorage.OrbitScript:Clone()
game.ServerStorage.OrbitScript.Parent = Part
atrribute:SetAttribute("OrbitRadius", OrbitRadius * i)
atrribute:SetAttribute("OrbitSpeed", OrbitSpeed * i)
Part.Material = "Neon"
Part.Size = Vector3.new(Size, Size, Size)
Part.Shape = "Ball"
Part.BrickColor = BrickColor.new(Colour)
wait()
end
I have no clue what I am doing wrong so if anyone knows what, it will be appreciated.
Thanks
Tangy