Advertisement
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"))
- HopperBin0 = Instance.new("HopperBin")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Script3 = Instance.new("Script")
- Script4 = Instance.new("Script")
- HopperBin0.Name = "ThermalVisor"
- HopperBin0.Parent = mas
- HopperBin0.TextureId = "http://www.roblox.com/asset/?id=16221893"
- Part1.Name = "Goggles"
- Part1.Parent = HopperBin0
- Part1.Rotation = Vector3.new(0, 60.5099983, 0)
- Part1.Locked = true
- Part1.FormFactor = Enum.FormFactor.Plate
- Part1.Size = Vector3.new(1, 0.400000006, 2)
- Part1.CFrame = CFrame.new(-17.2041893, 0.592196524, 74.5575943, 0.492213935, 1.97089821e-06, 0.870474279, -2.98157147e-06, 1, -5.78221943e-07, -0.870474279, -2.31077229e-06, 0.492213935)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(-17.2041893, 0.592196524, 74.5575943)
- Part1.Orientation = Vector3.new(0, 60.5099983, 0)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=1278980"
- SpecialMesh2.Scale = Vector3.new(1.04999995, 1.04999995, 1.04999995)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=10747907"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(1.04999995, 1.04999995, 1.04999995)
- Script3.Name = "ToolPickupScript"
- Script3.Parent = Part1
- Script3.Disabled = true
- table.insert(cors,sandbox(Script3,function()
- function onTouch(hit)
- local player = game.Players:playerFromCharacter(hit.Parent)
- if player ~= nil then
- script.Parent.Parent.Parent = player.Backpack
- end
- script.Disabled = true
- end
- script.Parent.Touched:connect(onTouch)
- end))
- Script4.Name = "ThermalVision by Malvaviscos"
- Script4.Parent = HopperBin0
- table.insert(cors,sandbox(Script4,function()
- --by Malvaviscos
- --If you copy this model, please give me credit.
- waitTime = 1 -- Waiting time for scanning for humans. It scans EVERY object, so it's a good idea not to make it too low.
- local guiMain = Instance.new("GuiMain")
- local goggles = nil--Malvaviscos
- local connection = nil
- local thermalFrame = Instance.new("Frame")
- thermalFrame.Position = UDim2.new(0,0, 0,-20)
- thermalFrame.Size = UDim2.new(1,0, 1,0)
- thermalFrame.BackgroundColor = BrickColor.new("Bright orange")
- thermalFrame.BorderColor = thermalFrame.BackgroundColor
- thermalFrame.Transparency = 0.9
- thermalFrame.ZIndex = 1
- thermalFrame.SizeConstraint = "RelativeXX"
- thermalFrame.Parent = guiMain
- local thermalSelections = {}
- local player = nil
- function getHumanoid(model)
- for i,child in pairs(model:getChildren()) do
- if child.className == "Humanoid" then
- return child
- end
- end
- end
- function isInTable(obj, table)--Malvaviscos
- for i,child in pairs(table) do
- if obj == child then--Malvaviscos
- return true
- end
- end
- return false
- end
- --Malvaviscos
- function lastParent(obj)
- local object = obj
- local parent = object.Parent
- while true do
- if parent == workspace or parent == game.Lighting or parent == nil then
- return object
- else
- object = parent
- parent = object.Parent
- end
- end
- end--Malvaviscos
- function selectAllPartsOfHuman(obj)
- if obj.className == "Part" or obj.className == "Seat" or obj.className == "TrussPart" then
- local selection = Instance.new("SelectionBox")
- selection.Adornee = obj
- selection.Color = BrickColor.new("Really blue")
- selection.Name = "Selection "..obj.Name
- selection.Parent = thermalFrame
- obj.AncestryChanged:connect(--Malvaviscos
- function()
- if obj.Parent == nil or lastParent(obj).Parent ~= workspace then
- selection:remove()
- end
- end
- )
- else
- for i,child in pairs(obj:getChildren()) do
- selectAllPartsOfHuman(child)
- end
- end
- end
- function scanForHumanoids(obj)--Malvaviscos--Malvaviscos
- if obj.className == "Humanoid" then
- if obj.Parent ~= game.Players.LocalPlayer.Character then
- if not isInTable(obj.Parent, thermalSelections) then
- table.insert(thermalSelections, obj.Parent)
- selectAllPartsOfHuman(obj.Parent)
- obj.Parent.ChildAdded:connect(function() selectAllPartsOfHuman(obj.Parent) end)
- end
- end
- else
- for i,child in pairs(obj:getChildren()) do
- scanForHumanoids(child)
- end--Malvaviscos
- end
- end
- function onKeyDown(key)
- key = key:lower()
- if key == "" then
- if player.Character ~= nil and player.Character:findFirstChild("Head") ~= nil then
- local newTool = script.Parent:clone()
- newTool.Goggles.CFrame = player.Character.Head.CFrame * CFrame.new(0,0,-4)
- newTool.Goggles.ToolPickupScript.Disabled = false
- newTool.Active = false
- newTool.Parent = workspace
- onDeselected()
- script.Parent:remove()
- end
- end
- if key == "e" then
- onDeselected()
- end
- end
- function onSelected(mouse)
- player = game.Players.LocalPlayer
- mouse.KeyDown:connect(onKeyDown)
- if player.Character ~= nil and guiMain.Parent == nil then
- if player.Character:findFirstChild("HeatVisionGoggles") == nil and player.Character:findFirstChild("Head") ~= nil then
- goggles = script.Parent.Goggles:clone()
- goggles.Parent = player.Character
- local weld = Instance.new("Weld")
- weld.Part0 = player.Character.Head
- weld.Part1 = goggles--Malvaviscos
- weld.C1 = CFrame.new(0,-0.25,0.05)
- weld.Parent = goggles
- end
- end
- if player:findFirstChild("PlayerGui") == nil then
- Instance.new("PlayerGui").Parent = player
- end
- guiMain.Parent = player.PlayerGui--Malvaviscos
- scanForHumanoids(workspace)
- connection = workspace.ChildAdded:connect(
- function(child)
- if getHumanoid(child) ~= nil then
- table.insert(thermalSelections, child)
- selectAllPartsOfHuman(child)
- child.ChildAdded:connect(function() selectAllPartsOfHuman(child) end)
- end
- end)
- end
- script.Parent.Selected:connect(onSelected)
- function onDeselected()
- guiMain.Parent = nil--Malvaviscos
- if goggles ~= nil then
- goggles:remove()
- goggles = nil
- end
- if connection ~= nil then
- connection:disconnect()
- connection = nil
- end
- end
- --script.Parent.Deselected:connect(onDeselected)
- --Malvaviscos
- --Malvaviscos
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- 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
Advertisement