Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(Enum,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")
- Decal2 = Instance.new("Decal")
- Script3 = Instance.new("Script")
- NumberValue4 = Instance.new("NumberValue")
- BodyGyro5 = Instance.new("BodyGyro")
- BodyPosition6 = Instance.new("BodyPosition")
- BodyVelocity7 = Instance.new("BodyVelocity")
- Model0.Name = "Im Looking At You"
- Model0.Parent = mas
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(-5.90999985, 8.82788563, -10.7949982, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(-5.90999985, 8.82788563, -10.7949982)
- Part1.Size = Vector3.new(4, 3.91999936, 3.85000038)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Decal2.Name = "faic"
- Decal2.Parent = Part1
- Decal2.Texture = "http://www.roblox.com/asset/?id=65724729"
- Script3.Name = "Aim"
- Script3.Parent = Part1
- table.insert(cors,sandbox(Script3,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(0,0,0) * bin.Speed.Value
- 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(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- NumberValue4.Name = "Speed"
- NumberValue4.Parent = Part1
- NumberValue4.Value = 0.2
- BodyGyro5.Parent = Part1
- BodyGyro5.CFrame = CFrame.new(-81.6501541, 267.066833, 20.9726334, -0.486033261, 0.203790069, -0.849847794, 2.64563482e-09, 0.972432256, 0.233185336, 0.873940289, 0.113335826, -0.472634435)
- BodyGyro5.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro5.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro5.cframe = CFrame.new(-81.6501541, 267.066833, 20.9726334, -0.486033261, 0.203790069, -0.849847794, 2.64563482e-09, 0.972432256, 0.233185336, 0.873940289, 0.113335826, -0.472634435)
- BodyPosition6.Parent = Part1
- BodyPosition6.Position = Vector3.new(-5.90999985, 8.82800007, -10.7950001)
- BodyPosition6.position = Vector3.new(-5.90999985, 8.82800007, -10.7950001)
- BodyVelocity7.Parent = Part1
- BodyVelocity7.MaxForce = Vector3.new(INF, INF, INF)
- BodyVelocity7.maxForce = Vector3.new(INF, INF, INF)
- BodyVelocity7.Velocity = Vector3.new(0, 0, 0)
- BodyVelocity7.velocity = Vector3.new(0, 0, 0)
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement