Categories > Coding > Lua >
Need this script to clone the decedents
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)
i use arch btw
Replied
edited so your brain will hurt less
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post