Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Script3 = Instance.new("Script")
- Script4 = Instance.new("Script")
- Script5 = Instance.new("Script")
- Sound6 = Instance.new("Sound")
- Script7 = Instance.new("Script")
- Sound8 = Instance.new("Sound")
- Script9 = Instance.new("Script")
- Sound10 = Instance.new("Sound")
- Script11 = Instance.new("Script")
- Sound12 = Instance.new("Sound")
- Script13 = Instance.new("Script")
- Part14 = Instance.new("Part")
- SpecialMesh15 = Instance.new("SpecialMesh")
- Script16 = Instance.new("Script")
- Part17 = Instance.new("Part")
- SpecialMesh18 = Instance.new("SpecialMesh")
- Script19 = Instance.new("Script")
- Part20 = Instance.new("Part")
- SpecialMesh21 = Instance.new("SpecialMesh")
- Script22 = Instance.new("Script")
- Part23 = Instance.new("Part")
- Script24 = Instance.new("Script")
- ParticleEmitter25 = Instance.new("ParticleEmitter")
- ParticleEmitter26 = Instance.new("ParticleEmitter")
- Part27 = Instance.new("Part")
- SpecialMesh28 = Instance.new("SpecialMesh")
- Script29 = Instance.new("Script")
- Part30 = Instance.new("Part")
- SpecialMesh31 = Instance.new("SpecialMesh")
- Script32 = Instance.new("Script")
- Model0.Name = "Tornado by anphu04"
- Model0.Parent = mas
- Part1.Name = "Tornado"
- Part1.Parent = Model0
- Part1.Rotation = Vector3.new(-180, 0, 0)
- Part1.Anchored = true
- Part1.CanCollide = false
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(90, 455, 90)
- Part1.CFrame = CFrame.new(-28.3609047, 227.900055, 19.8399696, 1, 0, 0, 0, -1, 8.74227766e-08, 0, -8.74227766e-08, -1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Weld
- Part1.Position = Vector3.new(-28.3609047, 227.900055, 19.8399696)
- Part1.Orientation = Vector3.new(0, 180, 180)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=36755354"
- SpecialMesh2.Scale = Vector3.new(200, 250, 200)
- SpecialMesh2.TextureId = "rbxassetid://38426946"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(200, 250, 200)
- Script3.Name = "Animate"
- Script3.Parent = Part1
- table.insert(cors,sandbox(Script3,function()
- -- Made by anphu04, 11/16/2017 --
- local tor = script.Parent
- local mesh = tor.Mesh
- local rootpos = tor.Position
- local restingTime = math.random(1, 3)
- local maxMovingDistance = 50
- local maxAllowedRange = 50*20
- local spin = coroutine.resume(coroutine.create(function()
- while wait() do
- tor.CFrame = tor.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(-2), 0)
- end
- end))
- --[[local grow = coroutine.resume(coroutine.create(function()
- while true do
- for a = 1, 10 do
- mesh.Scale = mesh.Scale + Vector3.new(5, 0, 5)
- wait(0.1)
- end
- wait(0.1)
- for b = 1, 10 do
- mesh.Scale = mesh.Scale - Vector3.new(5, 0, 5)
- wait(0.1)
- end
- wait(0.1)
- end
- end))]]--
- local move = coroutine.resume(coroutine.create(function()
- while wait(restingTime) do
- local pickedpos = tor.Position + Vector3.new(math.random(-maxMovingDistance, maxMovingDistance), 0, math.random(-maxMovingDistance, maxMovingDistance))
- local dist = (pickedpos - tor.Position).magnitude
- local unit = (pickedpos - tor.Position).unit
- -- move the tornado in a random position
- for i = 0, dist, 1 do
- local currentrotation = tor.CFrame - tor.CFrame.p
- tor.CFrame = CFrame.new(tor.Position + unit * dist / 25) * currentrotation
- wait()
- end
- --check if the tornado goes too far, if so it will go back to it's root position
- if (pickedpos - rootpos).magnitude >= maxAllowedRange then
- local ldist = (pickedpos - rootpos).magnitude
- local lunit = (pickedpos - rootpos).unit
- print("Tornado went too far, going back (distance: " ..ldist.. " studs away)")
- for i = 0, ldist, 1 do
- local currentrotation = tor.CFrame - tor.CFrame.p
- tor.CFrame = CFrame.new(tor.Position - lunit * ldist / (ldist*0.75)) * currentrotation
- wait()
- end
- end
- end
- end))
- end))
- Script4.Name = "Hazard"
- Script4.Parent = Part1
- table.insert(cors,sandbox(Script4,function()
- -- Made by anphu04, 11/17/2017 --
- -- The calculating is to mainly make the tornado looks realistic, you can change it if you want
- local tor = script.Parent
- local debounce = false
- local attackrange = 25
- --[[function onTouched(p)
- if not p:FindFirstChild("TornadoSuckingForce") then
- if debounce == false then
- debounce = true
- local bp = Instance.new("BodyPosition")
- bp.Name = "TornadoSuckingForce"
- bp.MaxForce = Vector3.new(2000 * p:GetMass(), 2000 * p:GetMass(), 2000 * p:GetMass())
- bp.Parent = p
- spawn(function()
- local height = 0
- repeat
- bp.Position = (CFrame.new(tor.Position - Vector3.new(0, tor.Size.Y/2, 0))*CFrame.Angles(0,math.pi*2*((tick()/5)%1),0)*CFrame.new(tor.Size.X/2 + height/50, height, 0)).p -- the x will make the parts get farther away from the tornado, and y will make it move up
- height = height + (tor.Size.Y/100*0.5) -- aka 2% of it's Y size
- wait()
- until height == height * tor.Size.Y/5 -- a very large number but it might fit the looks
- bp:remove()
- end)
- p.Anchored = false
- p:BreakJoints()
- game.Debris:AddItem(p, 60)
- wait(0.1)
- debounce = false
- end
- end
- end]]--
- local near = coroutine.resume(coroutine.create(function()
- while wait() do
- local region = Region3.new(
- Vector3.new(tor.Position.X - tor.Size.X/2 - attackrange, tor.Position.Y - tor.Size.Y/2 - attackrange, tor.Position.Z - tor.Size.Z/2 - attackrange),
- Vector3.new(tor.Position.X + tor.Size.X/2 + attackrange, tor.Position.Y + tor.Size.Y/2 + attackrange, tor.Position.Z + tor.Size.Z/2 + attackrange)
- )
- local parts = workspace:FindPartsInRegion3(region)
- for i,p in pairs(parts) do
- if p:IsA("BasePart") and p.CanCollide == true and p:GetMass() < 1000000 then
- if not p:FindFirstChild("TornadoSuckingForce") then
- -- enssential stuff
- local bp = Instance.new("BodyPosition")
- bp.Name = "TornadoSuckingForce"
- bp.MaxForce = Vector3.new(2000 * p:GetMass(), 2000 * p:GetMass(), 2000 * p:GetMass())
- bp.Parent = p
- -- this will let the parts handle itself, instead of a whole script handling everything to reduce lag
- local torvalue = Instance.new("ObjectValue")
- torvalue.Name = "WhichTornado"
- torvalue.Value = tor
- torvalue.Parent = p
- local scr = script.SuckingScript:Clone()
- scr.Parent = p
- scr.Disabled = false
- -- extra stuff
- local bav = Instance.new("BodyAngularVelocity")
- bav.Name = "SuckingRotation"
- bav.MaxTorque = Vector3.new(4000 * p:GetMass(), 4000 * p:GetMass(), 4000 * p:GetMass())
- bav.AngularVelocity = Vector3.new(math.random(1,25), math.random(1,25), math.random(1,25))
- bav.Parent = p
- end
- end
- end
- end
- end))
- --tor.Touched:connect(onTouched)
- end))
- Script5.Name = "SuckingScript"
- Script5.Parent = Script4
- table.insert(cors,sandbox(Script5,function()
- local sp = script.Parent
- repeat
- wait()
- until sp:FindFirstChild("WhichTornado")
- local tor = sp:FindFirstChild("WhichTornado").Value
- local bp = sp:FindFirstChild("TornadoSuckingForce")
- sp.Anchored = false
- sp:BreakJoints()
- game.Debris:AddItem(sp, 60)
- local height = 0
- repeat
- bp.Position = (CFrame.new(tor.Position - Vector3.new(0, tor.Size.Y/2, 0))*CFrame.Angles(0,math.pi*2*((tick()/5)%1),0)*CFrame.new(tor.Size.X/2 + height/30, height, 0)).p -- the x will make the parts get farther away from the tornado, and y will make it move up
- height = height + (tor.Size.Y/100*0.5) -- aka 2% of it's Y size
- wait()
- until height == tor.Size.Y -- a very large number but it might fit the looks
- bp:remove()
- end))
- Sound6.Name = "wind"
- Sound6.Parent = Part1
- Sound6.Pitch = 0.69999998807907
- Sound6.SoundId = "rbxassetid://318451789"
- Sound6.Volume = 1
- Sound6.Looped = true
- Script7.Name = "runSound"
- Script7.Parent = Sound6
- table.insert(cors,sandbox(Script7,function()
- script.Parent:Play()
- script:remove()
- end))
- Sound8.Name = "wind2"
- Sound8.Parent = Part1
- Sound8.SoundId = "rbxassetid://184973424"
- Sound8.Volume = 1
- Sound8.Looped = true
- Script9.Name = "runSound"
- Script9.Parent = Sound8
- table.insert(cors,sandbox(Script9,function()
- script.Parent:Play()
- script:remove()
- end))
- Sound10.Name = "wind"
- Sound10.Parent = Part1
- Sound10.Pitch = 0.69999998807907
- Sound10.SoundId = "rbxassetid://318451789"
- Sound10.Volume = 1
- Sound10.Looped = true
- Script11.Name = "runSound"
- Script11.Parent = Sound10
- table.insert(cors,sandbox(Script11,function()
- script.Parent:Play()
- script:remove()
- end))
- Sound12.Name = "wind2"
- Sound12.Parent = Part1
- Sound12.SoundId = "rbxassetid://184973424"
- Sound12.Volume = 1
- Sound12.Looped = true
- Script13.Name = "runSound"
- Script13.Parent = Sound12
- table.insert(cors,sandbox(Script13,function()
- script.Parent:Play()
- script:remove()
- end))
- Part14.Name = "Dust"
- Part14.Parent = Model0
- Part14.BrickColor = BrickColor.new("Dark stone grey")
- Part14.Transparency = 0.5
- Part14.Rotation = Vector3.new(0, -45, 0)
- Part14.Anchored = true
- Part14.CanCollide = false
- Part14.FormFactor = Enum.FormFactor.Plate
- Part14.Size = Vector3.new(200, 30, 200)
- Part14.CFrame = CFrame.new(-28.3609924, 15.0000095, 19.8400307, 0.707106829, 0, -0.707106829, 0, 1, 0, 0.707106829, 0, 0.707106829)
- Part14.BottomSurface = Enum.SurfaceType.Smooth
- Part14.TopSurface = Enum.SurfaceType.Smooth
- Part14.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part14.Position = Vector3.new(-28.3609924, 15.0000095, 19.8400307)
- Part14.Orientation = Vector3.new(0, -45, 0)
- Part14.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh15.Parent = Part14
- SpecialMesh15.MeshId = "http://www.roblox.com/asset/?id=111820358"
- SpecialMesh15.Scale = Vector3.new(400, 100, 320)
- SpecialMesh15.MeshType = Enum.MeshType.FileMesh
- SpecialMesh15.Scale = Vector3.new(400, 100, 320)
- Script16.Name = "Spin&Follow"
- Script16.Parent = Part14
- table.insert(cors,sandbox(Script16,function()
- -- Made by anphu04, 11/16/2017 --
- local dust = script.Parent
- local mesh = dust.Mesh
- local tor = script.Parent.Parent.Tornado
- local yoffset = tor.Size.Y / 2 -- the y position that the dust will be at when it follows the tornado
- local spin = coroutine.resume(coroutine.create(function()
- local randomAngle = math.random(1, 10)/10
- while wait() do
- dust.CFrame = dust.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(randomAngle), 0)
- end
- end))
- local grow = coroutine.resume(coroutine.create(function()
- local randomIncrement = math.random(1, 50)/10
- while true do
- for a = 1, 10 do
- mesh.Scale = mesh.Scale + Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- for b = 1, 10 do
- mesh.Scale = mesh.Scale - Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- end
- end))
- local follow = coroutine.resume(coroutine.create(function()
- while wait() do
- local currentrotation = dust.CFrame - dust.CFrame.p
- local ypos = tor.Position.Y - yoffset
- dust.CFrame = CFrame.new(tor.Position.X, ypos, tor.Position.Z) * currentrotation
- end
- end))
- end))
- Part17.Name = "Dust"
- Part17.Parent = Model0
- Part17.BrickColor = BrickColor.new("Dark stone grey")
- Part17.Transparency = 0.5
- Part17.Anchored = true
- Part17.CanCollide = false
- Part17.FormFactor = Enum.FormFactor.Plate
- Part17.Size = Vector3.new(200, 30, 200)
- Part17.CFrame = CFrame.new(-28.3609924, 15.0000095, 19.8400307, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part17.BottomSurface = Enum.SurfaceType.Smooth
- Part17.TopSurface = Enum.SurfaceType.Smooth
- Part17.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part17.Position = Vector3.new(-28.3609924, 15.0000095, 19.8400307)
- Part17.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh18.Parent = Part17
- SpecialMesh18.MeshId = "http://www.roblox.com/asset/?id=111820358"
- SpecialMesh18.Scale = Vector3.new(425, 175, 355)
- SpecialMesh18.MeshType = Enum.MeshType.FileMesh
- SpecialMesh18.Scale = Vector3.new(425, 175, 355)
- Script19.Name = "Spin&Follow"
- Script19.Parent = Part17
- table.insert(cors,sandbox(Script19,function()
- -- Made by anphu04, 11/16/2017 --
- local dust = script.Parent
- local mesh = dust.Mesh
- local tor = script.Parent.Parent.Tornado
- local yoffset = tor.Size.Y / 2 -- the y position that the dust will be at when it follows the tornado
- local spin = coroutine.resume(coroutine.create(function()
- local randomAngle = math.random(1, 10)/10
- while wait() do
- dust.CFrame = dust.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(randomAngle), 0)
- end
- end))
- local grow = coroutine.resume(coroutine.create(function()
- local randomIncrement = math.random(1, 50)/10
- while true do
- for a = 1, 10 do
- mesh.Scale = mesh.Scale + Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- for b = 1, 10 do
- mesh.Scale = mesh.Scale - Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- end
- end))
- local follow = coroutine.resume(coroutine.create(function()
- while wait() do
- local currentrotation = dust.CFrame - dust.CFrame.p
- local ypos = tor.Position.Y - yoffset
- dust.CFrame = CFrame.new(tor.Position.X, ypos, tor.Position.Z) * currentrotation
- end
- end))
- end))
- Part20.Name = "Dust"
- Part20.Parent = Model0
- Part20.BrickColor = BrickColor.new("Dark stone grey")
- Part20.Transparency = 0.5
- Part20.Rotation = Vector3.new(0, -90, 0)
- Part20.Anchored = true
- Part20.CanCollide = false
- Part20.FormFactor = Enum.FormFactor.Plate
- Part20.Size = Vector3.new(200, 30, 200)
- Part20.CFrame = CFrame.new(-28.3609924, 15.0000095, 19.8400307, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Part20.BottomSurface = Enum.SurfaceType.Smooth
- Part20.TopSurface = Enum.SurfaceType.Smooth
- Part20.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part20.Position = Vector3.new(-28.3609924, 15.0000095, 19.8400307)
- Part20.Orientation = Vector3.new(0, -90, 0)
- Part20.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh21.Parent = Part20
- SpecialMesh21.MeshId = "http://www.roblox.com/asset/?id=111820358"
- SpecialMesh21.Scale = Vector3.new(450, 300, 380)
- SpecialMesh21.MeshType = Enum.MeshType.FileMesh
- SpecialMesh21.Scale = Vector3.new(450, 300, 380)
- Script22.Name = "Spin&Follow"
- Script22.Parent = Part20
- table.insert(cors,sandbox(Script22,function()
- -- Made by anphu04, 11/16/2017 --
- local dust = script.Parent
- local mesh = dust.Mesh
- local tor = script.Parent.Parent.Tornado
- local yoffset = tor.Size.Y / 2 -- the y position that the dust will be at when it follows the tornado
- local spin = coroutine.resume(coroutine.create(function()
- local randomAngle = math.random(1, 10)/10
- while wait() do
- dust.CFrame = dust.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(randomAngle), 0)
- end
- end))
- local grow = coroutine.resume(coroutine.create(function()
- local randomIncrement = math.random(1, 50)/10
- while true do
- for a = 1, 10 do
- mesh.Scale = mesh.Scale + Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- for b = 1, 10 do
- mesh.Scale = mesh.Scale - Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- end
- end))
- local follow = coroutine.resume(coroutine.create(function()
- while wait() do
- local currentrotation = dust.CFrame - dust.CFrame.p
- local ypos = tor.Position.Y - yoffset
- dust.CFrame = CFrame.new(tor.Position.X, ypos, tor.Position.Z) * currentrotation
- end
- end))
- end))
- Part23.Name = "Smoke"
- Part23.Parent = Model0
- Part23.Transparency = 1
- Part23.Anchored = true
- Part23.CanCollide = false
- Part23.FormFactor = Enum.FormFactor.Symmetric
- Part23.Size = Vector3.new(70, 22, 70)
- Part23.CFrame = CFrame.new(-28.3609047, 11.4000216, 19.8399696, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part23.BottomSurface = Enum.SurfaceType.Smooth
- Part23.TopSurface = Enum.SurfaceType.Weld
- Part23.Position = Vector3.new(-28.3609047, 11.4000216, 19.8399696)
- Script24.Name = "Spin&Follow"
- Script24.Parent = Part23
- table.insert(cors,sandbox(Script24,function()
- -- Made by anphu04, 11/16/2017 --
- local dust = script.Parent
- local tor = script.Parent.Parent.Tornado
- local yoffset = tor.Size.Y / 2 -- the y position that the dust will be at when it follows the tornado
- local spin = coroutine.resume(coroutine.create(function()
- local randomAngle = math.random(1, 10)/10
- while wait() do
- dust.CFrame = dust.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(randomAngle), 0)
- end
- end))
- local follow = coroutine.resume(coroutine.create(function()
- while wait() do
- local currentrotation = dust.CFrame - dust.CFrame.p
- local ypos = tor.Position.Y - yoffset
- dust.CFrame = CFrame.new(tor.Position.X, ypos, tor.Position.Z) * currentrotation
- end
- end))
- end))
- ParticleEmitter25.Name = "BigSmoke(lol)"
- ParticleEmitter25.Parent = Part23
- ParticleEmitter25.Transparency = NumberSequence.new(0,1)
- ParticleEmitter25.Size = NumberSequence.new(10,10,1)
- ParticleEmitter25.Color = ColorSequence.new(Color3.new(0.368627, 0.368627, 0.368627),Color3.new(0.368627, 0.368627, 0.368627))
- ParticleEmitter25.Texture = "rbxassetid://494864527"
- ParticleEmitter25.Acceleration = Vector3.new(0, -1, 0)
- ParticleEmitter25.Lifetime = NumberRange.new(3, 7)
- ParticleEmitter25.Rate = 250
- ParticleEmitter25.RotSpeed = NumberRange.new(180, 180)
- ParticleEmitter25.Speed = NumberRange.new(25, 25)
- ParticleEmitter25.VelocitySpread = -180
- ParticleEmitter25.Color = ColorSequence.new(Color3.new(0.368627, 0.368627, 0.368627),Color3.new(0.368627, 0.368627, 0.368627))
- ParticleEmitter26.Name = "SmallParticles"
- ParticleEmitter26.Parent = Part23
- ParticleEmitter26.Transparency = NumberSequence.new(0,1,1)
- ParticleEmitter26.Rotation = NumberRange.new(1000, 1000)
- ParticleEmitter26.Size = NumberSequence.new(70,70)
- ParticleEmitter26.Color = ColorSequence.new(Color3.new(0, 0, 0),Color3.new(0, 0, 0))
- ParticleEmitter26.Texture = "http://www.roblox.com/asset/?id=180306779"
- ParticleEmitter26.Lifetime = NumberRange.new(5, 5)
- ParticleEmitter26.Rate = 50
- ParticleEmitter26.RotSpeed = NumberRange.new(-250, 250)
- ParticleEmitter26.Speed = NumberRange.new(50, 50)
- ParticleEmitter26.VelocitySpread = 50
- ParticleEmitter26.Color = ColorSequence.new(Color3.new(0, 0, 0),Color3.new(0, 0, 0))
- Part27.Name = "InsideOutTornado"
- Part27.Parent = Model0
- Part27.Rotation = Vector3.new(-180, 0, -180)
- Part27.Anchored = true
- Part27.CanCollide = false
- Part27.FormFactor = Enum.FormFactor.Symmetric
- Part27.Size = Vector3.new(90, 455, 90)
- Part27.CFrame = CFrame.new(-28.3609047, 227.900055, 19.8399696, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part27.BottomSurface = Enum.SurfaceType.Smooth
- Part27.TopSurface = Enum.SurfaceType.Weld
- Part27.Position = Vector3.new(-28.3609047, 227.900055, 19.8399696)
- Part27.Orientation = Vector3.new(0, 180, 0)
- SpecialMesh28.Parent = Part27
- SpecialMesh28.MeshId = "http://www.roblox.com/asset/?id=36755354"
- SpecialMesh28.Scale = Vector3.new(-200, -250, -200)
- SpecialMesh28.TextureId = "rbxassetid://38426946"
- SpecialMesh28.MeshType = Enum.MeshType.FileMesh
- SpecialMesh28.Scale = Vector3.new(-200, -250, -200)
- Script29.Name = "Spin&Follow"
- Script29.Parent = Part27
- table.insert(cors,sandbox(Script29,function()
- -- Made by anphu04, 11/16/2017 --
- local torn = script.Parent
- local tor = script.Parent.Parent.Tornado
- local yoffset = tor.Size.Y / 2 -- the y position that the torn will be at when it follows the tornado
- local spin = coroutine.resume(coroutine.create(function()
- while wait() do
- torn.CFrame = torn.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(2), 0) -- angle should be negative as the entire part is negative
- end
- end))
- local follow = coroutine.resume(coroutine.create(function()
- while wait() do
- local currentrotation = torn.CFrame - torn.CFrame.p
- local ypos = tor.Position.Y - yoffset
- torn.CFrame = CFrame.new(tor.Position) * currentrotation
- end
- end))
- end))
- Part30.Name = "Cloud"
- Part30.Parent = Model0
- Part30.Anchored = true
- Part30.CanCollide = false
- Part30.FormFactor = Enum.FormFactor.Plate
- Part30.Size = Vector3.new(200, 30, 200)
- Part30.CFrame = CFrame.new(-28.3609924, 407.000153, 19.8400307, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part30.BottomSurface = Enum.SurfaceType.Smooth
- Part30.TopSurface = Enum.SurfaceType.Smooth
- Part30.Position = Vector3.new(-28.3609924, 407.000153, 19.8400307)
- SpecialMesh31.Parent = Part30
- SpecialMesh31.MeshId = "http://www.roblox.com/asset/?id=111820358"
- SpecialMesh31.Scale = Vector3.new(900, 300, 700)
- SpecialMesh31.MeshType = Enum.MeshType.FileMesh
- SpecialMesh31.Scale = Vector3.new(900, 300, 700)
- Script32.Name = "Spin&Follow"
- Script32.Parent = Part30
- table.insert(cors,sandbox(Script32,function()
- -- Made by anphu04, 11/16/2017 --
- local cloud = script.Parent
- local mesh = cloud.Mesh
- local tor = script.Parent.Parent.Tornado
- local yoffset = tor.Size.Y / 2 - 20 -- the y position that the cloud will be at when it follows the tornado
- local spin = coroutine.resume(coroutine.create(function()
- local randomAngle = math.random(1, 10)/10
- while wait() do
- cloud.CFrame = cloud.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(randomAngle), 0)
- end
- end))
- local grow = coroutine.resume(coroutine.create(function()
- local randomIncrement = math.random(1, 50)/10
- while true do
- for a = 1, 10 do
- mesh.Scale = mesh.Scale + Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- for b = 1, 10 do
- mesh.Scale = mesh.Scale - Vector3.new(randomIncrement, 0, randomIncrement)
- wait(0.1)
- end
- wait(0.1)
- end
- end))
- local follow = coroutine.resume(coroutine.create(function()
- while wait() do
- local currentrotation = cloud.CFrame - cloud.CFrame.p
- local ypos = tor.Position.Y + yoffset -- us + to make it on the top
- cloud.CFrame = CFrame.new(tor.Position.X, ypos, tor.Position.Z) * currentrotation
- end
- end))
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment