Categories > Coding > Lua >

Need this script to clone the decedents

Posts: 45

Threads: 18

Joined: Aug, 2022

Reputation: 2

Posted

 i want the Parts to be cloned and put in into a folder in the workspace called "OrbitSpace". I have edited the script since i realised its not gonna work with what im trying to do. All the parts are in replicated storage and are called "Part1" "Part2" "Part3" "Part4". Script is below (edited cuz im dumb)

Tool = script.Parent

Tool.Equipped:Connect(function()
	print("Tool equipped")
end)

Tool.Activated:connect(function()
	local character = Tool.Parent
	local DISTANCE = 10 
	local increment = 0
	local parts = game.Workspace.OrbitSpace:GetDescendants() --this is where the parts are (insde the "OrbitPart")
	local offset = 360 / #parts 
	local rs = game:GetService("RunService")
	
		
	rs.Heartbeat:Connect(function(dt)
		increment += dt * 50
		print(increment)
		for i, v in pairs(parts) do 
			local trueOffset = offset * i
			v.Position = Vector3.new(character.Position.X + math.sin(math.rad(increment + trueOffset)) * DISTANCE, character.Position.Y, character.Position.Z + math.cos(math.rad(increment + trueOffset)) * DISTANCE)
		end
	end)
end)
  • 0

Posts: 1433

Threads: 71

Joined: May, 2022

Reputation: 20

Replied

this hurts my brain bro

  • 0

i use arch btw

Posts: 45

Threads: 18

Joined: Aug, 2022

Reputation: 2

Replied

edited so your brain will hurt less

 
  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )