Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- offS = Instance.new("Vector3Value")
- offS.Name = "Offset"
- offS.Value = Vector3.new(0,0,-100)
- offS.Parent = script
- Sc = Instance.new("NumberValue")
- Sc.Name = "Scale"
- Sc.Value = 5
- Sc.Parent = script
- script.Parent = game.Workspace
- local Model = Instance.new("Model",game.Lighting)
- Model.Name = "MinimapModel"
- local BoxModel = Instance.new("Model",script)
- BoxModel.Name = "MinimapBoxModel"
- local Ready = true
- function Track(item)
- local part = Instance.new("Part",Model)
- part.Anchored = true
- part.CanCollide = false
- part.Locked = true
- part.Archivable = false
- local box = Instance.new("SelectionBox",BoxModel)
- box.LineThickness = 0.015
- box.Adornee = part
- local Count = 0
- local Connection
- local function Beat()
- Count = Count + 1
- if Count > 2 then
- Count = 0
- if item and part and item:FindFirstAncestorWhichIsA("Workspace") and item:IsA("BasePart") and box then
- if item.CanCollide then
- box.Color3 = Color3.new(item.Color.r / 1.5,item.Color.g / 1.5,item.Color.b / 1.5)
- else
- box.Color3 = Color3.new(item.Color.r * 1.5,item.Color.g * 1.5,item.Color.b * 1.5)
- end
- box.SurfaceColor3 = item.Color
- box.SurfaceTransparency = item.Transparency
- part.Color = item.Color
- part.Material = item.Material
- part.Reflectance = item.Reflectance
- part.Transparency = item.Transparency
- part.Name = item:GetFullName().."Clone"
- part.Orientation = item.Orientation
- local Scale
- local SValue = script:FindFirstChild("Scale")
- if SValue and SValue:IsA("NumberValue") then
- Scale = SValue.Value
- else
- Scale = 5
- end
- local Offset
- local OValue = script:FindFirstChild("Offset")
- if OValue and OValue:IsA("Vector3Value") then
- Offset = OValue.Value
- else
- Offset = Vector3.new(0,0,-100)
- end
- part.Size = Vector3.new(item.Size.X / Scale,item.Size.Y / Scale,item.Size.Z / Scale)
- part.Position = Vector3.new(item.Position.X / Scale + Offset.X,item.Position.Y / Scale + Offset.Y,item.Position.Z / Scale + Offset.Z)
- elseif item and part and item:FindFirstAncestorWhichIsA("Workspace") and item:IsA("Explosion") and box then
- if item.DestroyJointRadiusPercent == 0 then
- box.Color3 = Color3.new(0.75,0.75,0.75)
- box.SurfaceColor3 = Color3.new(0.5,0.5,0.5)
- elseif item.BlastPressure >= 500000 and item.BlastPressure < 1500000 then
- box.Color3 = Color3.new(0.8,0.55,0)
- box.SurfaceColor3 = Color3.new(1,1,0)
- elseif item.BlastPressure >= 1500000 and item.BlastPressure <= 5000000 then
- box.Color3 = Color3.new(0.9,0.4,0)
- box.SurfaceColor3 = Color3.new(1,0.4,0)
- elseif item.BlastPressure >= 5000000 then
- box.Color3 = Color3.new(1,0,0)
- box.SurfaceColor3 = Color3.new(0.8,0,0)
- else
- box.Color3 = Color3.new(0.9,0.9,0.45)
- box.SurfaceColor3 = Color3.new(1,1,0.5)
- end
- box.SurfaceTransparency = 0.5
- part.Name = item:GetFullName().."Clone"
- local Scale
- local SValue = script:FindFirstChild("Scale")
- if SValue and SValue:IsA("NumberValue") then
- Scale = SValue.Value
- else
- Scale = 5
- end
- local Offset
- local OValue = script:FindFirstChild("Offset")
- if OValue and OValue:IsA("Vector3Value") then
- Offset = OValue.Value
- else
- Offset = Vector3.new(0,0,-100)
- end
- part.Size = Vector3.new(item.BlastRadius / Scale,item.BlastRadius / Scale,item.BlastRadius / Scale)
- part.Position = Vector3.new(item.Position.X / Scale + Offset.X,item.Position.Y / Scale + Offset.Y,item.Position.Z / Scale + Offset.Z)
- else
- if part then
- part:Destroy()
- end
- if box then
- box:Destroy()
- end
- Connection:Disconnect()
- end
- end
- end
- Connection = game:GetService("RunService").Heartbeat:connect(Beat)
- end
- function Added(obj)
- if (obj:IsA("BasePart") or obj:IsA("Explosion")) and not obj:IsA("Terrain") then
- repeat wait(0.03) until Ready == true
- if obj then
- Track(obj)
- Ready = false
- wait(0.03)
- Ready = true
- end
- end
- end
- game.Workspace.DescendantAdded:connect(Added)
- local D = game.Workspace:GetDescendants()
- for i = 1,#D do
- if (D[i]:IsA("BasePart") or D[i]:IsA("Explosion")) and not D[i]:IsA("Terrain") then
- repeat wait(0.03) until Ready == true
- if D[i] then
- Track(D[i])
- Ready = false
- wait(0.03)
- Ready = true
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement