Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- compatibility Layer --
- rconsoleinfo = rconsoleinfo or function() end
- -- SYN X ONLY IF NOT HAVE COMPATIBILITY LAYER --
- local protective_call_wrapper = function(real)
- if type(real) == "function" then
- local fake = function(...)
- local args = {...}
- local s,e_res = pcall(function()
- return {real(unpack(args))}
- end)
- if not s then
- rconsoleinfo("ERROR: "..tostring(e_res)) -- EXTERNAL CONSOLE
- else
- return unpack(e_res)
- end
- end
- return fake
- end
- return real
- end
- local MS_Bind = Instance.new("BindableEvent")
- local RS = game:GetService("RunService")
- local PathfindingService = game:GetService("PathfindingService")
- local path = PathfindingService:CreatePath({
- AgentRadius = 3,
- AgentHeight = 6,
- AgentCanJump = false,
- Costs = {
- Water = 20
- }
- })
- local localplayer = game:GetService("Players").LocalPlayer
- local Render3DFPS = 0
- local Render3DTick = tick()
- local lasttick = tick()
- local timing = lasttick - tick()
- local options = {
- enabled = true,
- character_render = true,
- pathfind = false
- }
- local players = {}
- local players_characters = {}
- local gcolor = Color3.fromHSV(tick() * 128 % 255/255, 1, 1)
- create3Dboxin2DScreen = protective_call_wrapper(create3Dboxin2DScreen)
- getboundingpoint = protective_call_wrapper(getboundingpoint)
- listworldpoint_to_viewpoint = protective_call_wrapper(listworldpoint_to_viewpoint)
- render_part_throught_wall = protective_call_wrapper(render_part_throught_wall)
- createrectangle = protective_call_wrapper(createrectangle)
- worldpoint_to_viewpoint = protective_call_wrapper(worldpoint_to_viewpoint)
- synTextLabel = protective_call_wrapper(synTextLabel)
- high_speed = protective_call_wrapper(high_speed)
- all_in_fov = protective_call_wrapper(all_in_fov)
- Lerp = protective_call_wrapper(Lerp)
- spawn(protective_call_wrapper(function()
- while true do
- rconsoleclear()
- printconsole(string.format("1) enabled:\t%s\n2) character render:\t%s\n3) pathfinding\t%s\n",tostring(options.enabled),tostring(options.character_render),tostring(options.pathfind)),0xff,0xff,0xff)
- local cmd_input = rconsoleinput():split(" ")
- if cmd_input[1] == "1" then
- options.enabled = not options.enabled
- elseif cmd_input[1] == "2" then
- options.character_render = not options.character_render
- elseif cmd_input[1] == "3" then
- options.pathfind = not options.pathfind
- end
- wait()
- end
- end))
- local playeradded = game:GetService("Players").PlayerAdded:Connect(protective_call_wrapper(function(plr)
- players[plr.Name] = synTextLabel()
- players_characters[plr.Name] = {}
- end))
- local playerremoving = game:GetService("Players").PlayerRemoving:Connect(protective_call_wrapper(function(plr)
- if players[plr.Name] then
- players[plr.Name].Visible = false
- spawn(function()
- while true do
- wait()
- local s, _ = pcall(function()
- players[plr.Name]:remove()
- end)
- if s then
- break
- end
- end
- end)
- end
- if players_characters[plr.Name] then
- for partname, faces in pairs(players_characters[plr.Name]) do
- for facename, drawingobject in pairs(faces) do
- spawn(function()
- local drawingobject = drawingobject
- drawingobject.Visible = false
- while true do
- wait()
- local s, _ = pcall(function()
- drawingobject:remove()
- end)
- if s then
- break
- end
- end
- end)
- end
- end
- end
- end))
- function all_in_fov(list)
- for _,boolean in pairs(list) do
- if not boolean[1] then
- return false
- end
- end
- return true
- end
- function high_speed()
- timing = tick() - lasttick
- if timing >= 1/1000 then
- lasttick = tick()
- MS_Bind:Fire(timing)
- end
- end
- function listworldpoint_to_viewpoint(poslist)
- local newarray = {}
- for i,pos in pairs(poslist) do
- newarray[i] = {worldpoint_to_viewpoint(pos)}
- end
- return newarray
- end
- function Lerp(a,b,t) -- a = current_value, b = target_value, t = percent max_value = 1
- return a * (1-t) + b * t
- end
- function synTextLabel()
- local TextLabel = Drawing.new("Text")
- TextLabel.Text = "Place"
- TextLabel.Size = 24
- TextLabel.Center = true
- TextLabel.Outline = true
- TextLabel.Color = Color3.new(255/255, 0/255, 0/255)
- TextLabel.OutlineColor = Color3.new(0, 0, 0)
- return TextLabel
- end
- function worldpoint_to_viewpoint(pos)
- local pos, in_fov = workspace.CurrentCamera:WorldToViewportPoint(pos.p)
- return in_fov, Vector2.new(pos.X,pos.Y)
- end
- function getboundingpoint(part)
- local pos = part.CFrame
- local Dfc = part.Size/2
- local partmesh = part:FindFirstChildOfClass("SpecialMesh")
- if partmesh then
- Dfc = partmesh.Scale/2
- end
- local bounding3D = {
- pos*CFrame.new(Dfc.X, Dfc.Y, Dfc.Z), -- 1, 1, 1 1
- pos*CFrame.new(Dfc.X, Dfc.Y, -Dfc.Z), -- 1, 1, 0 2
- pos*CFrame.new(-Dfc.X, Dfc.Y, -Dfc.Z), -- 0, 1, 0 3
- pos*CFrame.new(-Dfc.X, Dfc.Y, Dfc.Z), -- 0, 1, 1 4
- pos*CFrame.new(-Dfc.X,-Dfc.Y, Dfc.Z), -- 0, 0, 1 5
- pos*CFrame.new(-Dfc.X, -Dfc.Y, -Dfc.Z), -- 0, 0, 0 6
- pos*CFrame.new(Dfc.X, -Dfc.Y, -Dfc.Z), -- 1, 0, 0 7
- pos*CFrame.new(Dfc.X, -Dfc.Y, Dfc.Z) -- 1, 0, 1 8
- }
- return bounding3D
- end
- function createrectangle(properties)
- local rectangle = Drawing.new("Quad")
- local defaultproperties = {
- Visible = false,
- Thickness = 0.5,
- PointA = Vector2.new(0,0,0),
- PointB = Vector2.new(0,0,0),
- PointC = Vector2.new(0,0,0),
- PointD = Vector2.new(0,0,0),
- Color = Color3.new(1,1,1),
- Filled = true
- }
- for property,value in pairs(defaultproperties)do
- if properties[property] then
- value = properties[property]
- end
- local success, err = pcall(function()
- rectangle[property] = value
- end)
- end
- return rectangle
- end
- function update3Dboxin2DScreen(faces,visible,pos1,pos2,pos3,pos4,pos5,pos6,pos7,pos8)
- if #faces < 1 then
- rconsoleinfo("Faces Length = 0")
- return
- end
- local facesproperty ={
- {
- PointA = pos6,
- PointB = pos2,
- PointC = pos1,
- PointD = pos5,
- Visible = visible,
- Color = gcolor
- },
- {
- PointA = pos3,
- PointB = pos7,
- PointC = pos8,
- PointD = pos4,
- Visible = visible,
- Color = gcolor
- },
- {
- PointA = pos4,
- PointB = pos1,
- PointC = pos8,
- PointD = pos5,
- Visible = visible,
- Color = gcolor
- },
- {
- PointA = pos3,
- PointB = pos2,
- PointC = pos7,
- PointD = pos6,
- Visible = visible,
- Color = gcolor
- }
- }
- for face, properties in pairs(facesproperty)do
- for property, value in pairs(properties)do
- protective_call_wrapper(function()
- faces[face][property] = value
- end)()
- end
- end
- end
- function create3Dboxin2DScreen(pos1,pos2,pos3,pos4,pos5,pos6,pos7,pos8)
- local mainproperty ={
- PointA = pos6,
- PointB = pos2,
- PointC = pos1,
- PointD = pos5,
- }
- --mainproperty.Color = Color3.new(1,0,0)
- local box1 = createrectangle(mainproperty)
- mainproperty.PointA, mainproperty.PointB, mainproperty.PointC, mainproperty.PointD = pos3, pos7, pos8, pos4
- --mainproperty.Color = Color3.new(1,1,0)
- local box2 = createrectangle(mainproperty)
- mainproperty.PointA, mainproperty.PointB, mainproperty.PointC, mainproperty.PointD = pos4, pos1, pos8, pos5
- --mainproperty.Color = Color3.new(0,1,0)
- local box3 = createrectangle(mainproperty)
- mainproperty.PointA, mainproperty.PointB, mainproperty.PointC, mainproperty.PointD = pos3, pos2, pos7, pos6
- --mainproperty.Color = Color3.new(0,1,1)
- local box4 = createrectangle(mainproperty)
- return box1, box2, box3, box4
- end
- function create_part_render_throught_wall(part)
- if part.Name ~= "HumanoidRootPart" then
- local faces = {}
- local connerpositions = getboundingpoint(part)
- local resultfrom3D_to_2D = listworldpoint_to_viewpoint(connerpositions)
- local in_fov = all_in_fov(resultfrom3D_to_2D)
- faces[1], faces[2], faces[3], faces[4] = create3Dboxin2DScreen(
- resultfrom3D_to_2D[1][2],
- resultfrom3D_to_2D[2][2],
- resultfrom3D_to_2D[3][2],
- resultfrom3D_to_2D[4][2],
- resultfrom3D_to_2D[5][2],
- resultfrom3D_to_2D[6][2],
- resultfrom3D_to_2D[7][2],
- resultfrom3D_to_2D[8][2]
- )
- return faces
- end
- end
- protective_call_wrapper(function()
- for i=300,400 do
- RS:BindToRenderStep("Custom_Event_Speed",i,high_speed)
- end
- end)()
- local lastcolorchange = tick()
- RS:BindToRenderStep("RainbowColor", 300, protective_call_wrapper(function()
- if tick() - lastcolorchange >= 1/1000 then
- lastcolorchange = tick()
- gcolor = Color3.fromHSV((tick()/2) * 128 % 255/255, 1, 1)
- end
- end))
- protective_call_wrapper(function()
- for _, plr in pairs(game:GetService("Players"):GetPlayers()) do
- if plr ~= localplayer then
- players[plr.Name] = synTextLabel()
- players[plr.Name].ZIndex = 1
- players_characters[plr.Name] = {}
- end
- end
- end)()
- RS.RenderStepped:Connect(function(delta)
- Render3DFPS = 1/delta
- end)
- MS_Bind.Event:Connect(protective_call_wrapper(function()
- if tick() - Render3DTick > 1/50 and Render3DFPS > 50 then
- Render3DTick = tick()
- for playername, characterparts in pairs(players_characters) do
- local player = game:GetService("Players"):FindFirstChild(playername)
- if player then
- if player.Character and localplayer.Character then
- for _,part in pairs(player.Character:GetChildren()) do
- if part:IsA("BasePart") then
- local ptw = players_characters[playername][part.Name]
- if not ptw then
- players_characters[playername][part.Name] = create_part_render_throught_wall(part)
- ptw = players_characters[playername][part.Name]
- else
- local connerpositions = getboundingpoint(part)
- local resultfrom3D_to_2D = listworldpoint_to_viewpoint(connerpositions)
- local in_fov = all_in_fov(resultfrom3D_to_2D)
- local local_character_pos = localplayer.Character.HumanoidRootPart.CFrame
- if localplayer.Character.PrimaryPart then
- local_character_pos = localplayer.Character:GetPrimaryPartCFrame()
- end
- local character_pos = player.Character.HumanoidRootPart.CFrame
- if player.Character.PrimaryPart then
- character_pos = player.Character:GetPrimaryPartCFrame()
- end
- local dist = (local_character_pos.p - character_pos.p).Magnitude
- if dist > 2048 then
- in_fov = false
- end
- if #resultfrom3D_to_2D>0 then
- update3Dboxin2DScreen(unpack({
- ptw,
- in_fov and options.character_render,
- resultfrom3D_to_2D[1][2],
- resultfrom3D_to_2D[2][2],
- resultfrom3D_to_2D[3][2],
- resultfrom3D_to_2D[4][2],
- resultfrom3D_to_2D[5][2],
- resultfrom3D_to_2D[6][2],
- resultfrom3D_to_2D[7][2],
- resultfrom3D_to_2D[8][2]
- }))
- end
- end
- end
- end
- end
- end
- end
- end
- end))
- MS_Bind.Event:Connect(protective_call_wrapper(function()
- for playername,TextLabel in pairs(players) do
- local player = game:GetService("Players"):FindFirstChild(playername)
- if player then
- if not TextLabel then
- players[playername] = synTextLabel()
- TextLabel = players[playername]
- end
- if player.Character and localplayer.Character then
- if player.Character.PrimaryPart and localplayer.Character.PrimaryPart then
- local local_character_pos = localplayer.Character:GetPrimaryPartCFrame()
- local character_pos = player.Character:GetPrimaryPartCFrame()
- local dist = (local_character_pos.p - character_pos.p).Magnitude
- local in_fov, sc_pos = worldpoint_to_viewpoint(character_pos)
- local health = 1
- local maxhealth = 1
- local strformat = {}
- in_fov = in_fov and options.enabled
- if dist > 25000 then
- in_fov = false
- end
- if game.GameId == 1650291138 then
- maxhealth = player["MaxHealth"].Value
- maxstamina = player["MaxStamina"].Value
- maxhunger = player["MaxHunger"].Value
- maxbreathing = 100
- health = player["Health"].Value
- stamina = player["Stamina"].Value
- hunger = player["Hunger"].Value
- breathing = player["Breathing"].Value
- strformat = {"%s(%s)\nHealth: %.2f%%(%.2f/%.2f)\nstamina: %.2f(%.2f/%.2f)\nbreathing: %.2f\ndistance: %.2f", playername, player.DisplayName, (health/maxhealth)*100, health, maxhealth, (stamina/maxstamina)*100, stamina, maxstamina, (breathing/maxbreathing)*100, dist}
- elseif game.PlaceId == 6032399813 or game.PlaceId == 5735553160 then
- local hum = player.Character:FindFirstChildOfClass("Humanoid")
- local tool = nil
- if hum then
- health = hum.Health
- maxhealth = hum.MaxHealth
- tool = "None"
- local toolinstance = player.Character:FindFirstChildOfClass("Tool")
- if toolinstance then
- tool = toolinstance.Name
- if tool == "Weapon" and toolinstance:FindFirstChild("Weapon") then
- tool = toolinstance.Weapon.Value
- end
- end
- end
- strformat = {"%s %s(%s)\nHealth: %.2f%%(%.2f/%.2f)\ntool: %s\ndistance: %.2f", player.leaderstats.FirstName.Value, player.leaderstats.LastName.Value, playername, (health/maxhealth)*100, health, maxhealth, tool, dist}
- else
- local hum = player.Character:FindFirstChildOfClass("Humanoid")
- if hum then
- health = hum.Health
- maxhealth = hum.MaxHealth
- strformat = {"%s(%s)\nhealth: %.2f%%(%.2f/%.2f)\ndistance: %.2f", player.DisplayName, playername, (health/maxhealth)*100, health, maxhealth, dist}
- end
- end
- if in_fov then
- TextLabel.Size = Lerp(24,1,dist/25000)
- TextLabel.Position = sc_pos
- TextLabel.Color = gcolor
- TextLabel.Text = string.format(unpack(strformat))
- end
- TextLabel.Visible = in_fov
- end
- end
- end
- end
- end))
Add Comment
Please, Sign In to add comment