I’m attempting to make a working Tornado system, but instead of going from point to point, my tornado just goes to one point, then stops when using Humanoid:MoveTo()?
Script [Inside of Tornado Model]:
local minX = -253.99
local maxX = 253.99
local minZ = -254.97
local maxZ = 254.97
while true do
wait(.5)
for i, v in pairs(game.Workspace.PossibleFunnelParts:GetChildren()) do
script.Parent.Humanoid:MoveTo(game.Workspace.PossibleFunnelParts:GetChildren()[i].Position)
end
end
Any and all help is appreciated. Thanks! (I’m going to bed, I will read all replies when I get up. Sorry! )
local minX = -253.99
local maxX = 253.99
local minZ = -254.97
local maxZ = 254.97
while true do
wait(.5)
for i, v in pairs(game.Workspace.PossibleFunnelParts:GetChildren()) do
script.Parent.Humanoid:MoveTo(game.Workspace.PossibleFunnelParts:GetChildren()[i].Position)
-- Wait until thing has moved to the position.
end
end
I’d set the HumanoidRootPart CFrame to the Funnel part. script.Parent.HumanoidRootPart.CFrame = game.Workspace.PossibleFunnelParts:GetChildren()[i].CFrame
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0) --change 5 to time you want
local minX = -253.99
local maxX = 253.99
local minZ = -254.97
local maxZ = 254.97
while true do
wait(.5)
for i, v in pairs(game.Workspace.PossibleFunnelParts:GetChildren()) do
local tween = ts:Create(script.Parent.HumanoidRootPart,ti, {CFrame = game.Workspace.PossibleFunnelParts:GetChildren()[i].CFrame})
tween:Play()
end
end
Hope I got it all right!
Don’t hesitate to ask how it works/how to change it I’ll run through it if needed.
local minX = -253.99
local maxX = 253.99
local minZ = -254.97
local maxZ = 254.97
local X = math.random(minX, maxX)
local Z = math.random(minZ, maxZ)
local Y = 82.793
while true do
wait(.3)
script.Parent.Humanoid:MoveTo(Vector3.new(X,Y,Z))
script.Parent.Humanoid.MoveToFinished:Wait()
end
Then you would have to loop the part that changes the position:
local minX = -253.99
local maxX = 253.99
local minZ = -254.97
local maxZ = 254.97
while true do
local X = math.random(minX, maxX)
local Z = math.random(minZ, maxZ)
local Y = 82.793
wait(.3)
script.Parent.Humanoid:MoveTo(Vector3.new(X,Y,Z))
script.Parent.Humanoid.MoveToFinished:Wait()
end
You never update X Y and Z again, so they remain the same.