Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local part1 = Instance.new("Part", game.Workspace)
- local part6 = Instance.new("Part", part1)
- part6.Size = Vector3.new(0.1,0.1,0.1)
- part6.Transparency = 1
- part6.CanCollide = false
- local weld = Instance.new("Weld", part6)
- weld.Part0 = part1
- weld.Part1 = partl6
- part6.CFrame = CFrame.new(0,0,1.5)
- local part4 = Instance.new("Part", game.Workspace)
- local part3 = Instance.new("Part", game.Workspace)
- local part5 = Instance.new("Part", game.Workspace)
- part1.Size = Vector3.new(1.487, 0.985, 2.72)
- part5.Size = Vector3.new(1.5, 1.5, 1.5)
- part1.Transparency = 1
- part5.Transparency = 1
- part4.Size = Vector3.new(1.487, 0.985, 2.72)
- Meshlol = Instance.new("SpecialMesh")
- Meshlol.Parent = part4
- Meshlol.MeshId = "http://www.roblox.com/asset/?id=2540334246"
- Meshlol.TextureId = "http://www.roblox.com/asset/?id=2540334261"
- Meshlol.Scale = Vector3.new(1, 1, 1)
- Meshlol2 = Instance.new("SpecialMesh")
- Meshlol2.Parent = part3
- Meshlol2.MeshId = "http://www.roblox.com/asset/?id=2540333861"
- Meshlol2.TextureId = "http://www.roblox.com/asset/?id=2540333887"
- Meshlol2.Scale = Vector3.new(1, 1, 1)
- part3.Size = Vector3.new(1.03, 1.044, 1.185)
- part3.CanCollide = false
- part1.Position = Vector3.new(10, 10, 10)
- part5.CanCollide = false
- part5.Anchored = true
- part5.Position = Vector3.new(10, 10, 10)
- Weld4 = Instance.new("Weld")
- Weld4.Parent = part1
- Weld4.Part0 = part1
- Weld4.Part1 = part4
- Weld4.part1 = part4
- local bg = Instance.new("BodyGyro",part1)
- bg.D = 100
- bg.P = 10000
- bg.MaxTorque = Vector3.new(400000, 400000, 400000)
- local bg2 = Instance.new("BodyGyro",part3)
- bg2.D = 100
- bg2.P = 10000
- bg2.MaxTorque = Vector3.new(0, 400000, 0)
- local bp = Instance.new("BodyPosition",part1)
- bp.D = 100
- bp.P = 10000
- bp.position = Vector3.new(10, 10, 10)
- local bp2 = Instance.new("BodyPosition",part3)
- bp2.D = 100
- bp2.P = 10000
- bp2.position = Vector3.new(10,9.25,10)
- part3.Position = Vector3.new(10,9.25,10)
- wait(0.1)
- part3.CFrame = part3.CFrame * CFrame.Angles(math.rad(180), 0, 0)
- function move(target)
- local dir = (part5.Position - target.Position).unit
- local spawnPos = part5.Position
- local pos = spawnPos + (dir * 1)
- bg.cframe = CFrame.new(pos, pos + dir)
- bg2.cframe = CFrame.new(pos, pos + dir)
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 1000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Head")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- while true do
- local torso = findNearestTorso(part5.Position)
- if torso~=nil then
- move(torso)
- end
- task.wait()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement