local tableRad = 4
local plr = game.Players.LocalPlayer
local hum = plr.Character:WaitForChild('Humanoid')
local MaxSeats = 6
local seatPlaced = 6
local v2
local LookV
local ChairPos
local ChairCF
local degrees = 360/MaxSeats
for i = 0, seatPlaced do
local part = Instance.new('Part', workspace.Folder)
part.Size = Vector3.new(2,2,2)
part.Anchored = true
if i == 5 then
for i , v in pairs(workspace.Folder:GetChildren()) do
if v:IsA('Part') then
while wait() do
local tablePos = hum.Parent:WaitForChild('HumanoidRootPart').CFrame
v2 = (degrees) * seatPlaced
LookV = CFrame.Angles(math.rad(v2),0,0).LookVector
ChairPos = tablePos * CFrame.new(LookV * tableRad)
ChairCF = ChairPos * CFrame.Angles(math.rad(v2 + 180),0,math.rad(180))
v.CFrame = ChairCF
end
end
end
end
end
#why isnt it effect all parts
50 messages · Page 1 of 1 (latest)
what is the script supposed to do
its pet movement
and it supposed to follow the player
and it follows but
not all the test parts
what is it supposed to look like
like you want all parts to follow the player ?
circle
wait
im sending a vid rn
ok well the reason why this is only working on one part is because you put a while wait loop
alr
its still not gonna be a circle though im not sure how the math for this works
it was in the wrong place
local tableRad = 4
local plr = game.Players.LocalPlayer
local hum = plr.Character:WaitForChild('Humanoid')
local MaxSeats = 6
local seatPlaced = 6
local v2
local LookV
local ChairPos
local ChairCF
local degrees = 360/MaxSeats
for i = 0, seatPlaced do
local part = Instance.new('Part', workspace.Folder)
part.Size = Vector3.new(2,2,2)
part.Anchored = true
if i == 5 then
while wait() do
for i , v in pairs(workspace.Folder:GetChildren()) do
if v:IsA('Part') then
--while wait() do
local tablePos = hum.Parent:WaitForChild('HumanoidRootPart').CFrame
v2 = (degrees) * i
LookV = CFrame.Angles(math.rad(v2),0,0).LookVector
ChairPos = tablePos * CFrame.new(LookV * tableRad)
ChairCF = ChairPos * CFrame.Angles(math.rad(v2 + 180),0,math.rad(180))
v.CFrame = ChairCF
--end
end
end
end
end
end
anyway this should work now (assuming the math is correct)
wth
what is working
u dont see ?
i see
the red is your dot
basically here, its script generated parts, but you get the point
now imagine i have this folder
and as you see its well placed
--!strict
local folder = script.Parent
local main = folder:WaitForChild('Main')
local SIZE = 3
local SPACE = 25
local function CreateDotsFromFolder(dots: Folder)
local origin = main.Position + Vector3.new(
main.Size.X / 2,
main.Position.Y,
main.Size.Z / 2
)
local i = 0
local range = #dots:GetChildren()
for _, dot: any in dots:GetChildren() do
if not dot:IsA('Part') then continue end
local aplha = (i / range) * math.pi * 2
dot.Name = tostring(i)
dot.Anchored = true
dot.Position = Vector3.new(
(math.cos(aplha) * SPACE) + origin.X,
main.Position.Y,
(math.sin(aplha) * SPACE) + origin.Z
)
i += 1
end
end
CreateDotsFromFolder(workspace:WaitForChild('Dots'))
here is the script for it
so now for the final script @hearty sedge
--!strict
local sv = {}
sv.Players = game:GetService "Players"
local folder = workspace:WaitForChild('Dots')
local SPACE = 25
local function CreateDotsFromFolder(main: BasePart, dots: {Instance})
local origin = main.Position + Vector3.new(
main.Size.X / 2,
main.Position.Y,
main.Size.Z / 2
)
local i = 0
local range = #dots
for _, dot: any in dots do
if not dot:IsA('Part') then continue end
local aplha = (i / range) * math.pi * 2
dot.Anchored = true
dot.Position = Vector3.new(
(math.cos(aplha) * SPACE) + origin.X,
main.Position.Y,
(math.sin(aplha) * SPACE) + origin.Z
)
dot.Parent = main
i += 1
end
end
local CharacterAdded = function (character: Model)
local hrp = character:WaitForChild('HumanoidRootPart')
if not hrp:IsA('BasePart') then return end
local hum = character:FindFirstChildOfClass('Humanoid')
if not hum then return end
local list = {}
for _, parts in folder:GetChildren() do
local clone = parts:Clone()
clone.Parent = hrp
table.insert(list, clone)
end
repeat task.wait(.1)
CreateDotsFromFolder(hrp, list)
until hum.Health <= 0
for _, s in list do s:Destroy() end
end
local PlayerAdded = function (player: Player)
player.CharacterAdded:Connect(CharacterAdded)
end
sv.Players.PlayerAdded:Connect(PlayerAdded)
https://gyazo.com/0f311e10aeeea5f30518d69c6c40bf18
looks like this but you can like edit the task.wait(1) in the character added function with render step, or add tweens to be smoother