So as some of you may know, I've been trying to make a tornado-like tool for the last 4 days. I've progressed a lot but I've still probably got a lot to do for it to work perfectly, this is my script
mouse = game.Players.LocalPlayer:GetMouse() player = game.Players.LocalPlayer mouse.Button1Down:connect(function() for i,v in pairs(game.Workspace:GetChildren()) do if v.ClassName == "Part" then dist = (v.Position - player.Character.Torso.Position).magnitude if dist < 100 then move = Instance.new("BodyVelocity", v) move.Velocity = player.Character.Torso.CFrame.lookVector * 200 move.MaxForce = Vector3.new(math.huge,math.huge,math.huge) game:GetService("Debris"):AddItem(move, 1) end end end end)
What this currently does is makes anything close to it shoot in the direction the characters torso is facing but it needs to make it circle around the torso, I know this would be a loop. Im useless when it comes to the math in roblox scripting though and i have no idea where to even begin.
I've even tried to get free model tornadoes and they all say stuff like math.atan and honestly, I've never heard of that in the entirety of my scripting career (Which is only like a year, maybe less).
local angle=0
while v do v.CFrame=v.CFrame*CFrame.Angles(0, math.rad(angle), 0) angle=angle+.1 wait() end