zqozr_II
(duckling)
September 9, 2022, 6:35am
#1
Hello! This may be my second post about creating a tracer esp but now I have moved 1 step forward!, I am extremely close to making a tracer esp and need just few guides to adjustments of the script.
Here is the issue, there is a little offset issue which i find weird. But I feel like my code is right, it just needs adjustments. https://gyazo.com/7cf5d360c057ec021ed72b5d9efff1ad
The code and reference is below. The floating part is where the tracer should be pointing
local lplr = game:GetService('Players').LocalPlayer
local cam = workspace.CurrentCamera
local Vectorasd, OnScreen = cam:WorldToViewportPoint(workspace:WaitForChild('viewcheck').Position)
local tov2 = Vector2.new(Vectorasd.X, Vectorasd.Y)
local fromv2 = Vector2.new(cam.ViewportSize.X / 2, cam.ViewportSize.Y / 1)
local thickness = 2
local LineProperties = {}
LineProperties.To = tov2
LineProperties.from = fromv2
game:GetService('RunService').RenderStepped:Connect(function()
local tracer = script.Parent
local Vector, OnScreen = cam:WorldToViewportPoint(workspace:WaitForChild('viewcheck').Position)
-- tracer.From = Vector2.new(cam.ViewportSize.X / 2, cam.ViewportSize.Y / 2)
coroutine.resume(coroutine.create((function()
local To = Vector2.new(Vector.X, Vector.Y)
local Direction = (To - LineProperties.From);
local Center = (To + LineProperties.From) / 2
local Distance = Direction.Magnitude
local Theta = math.atan2(Direction.Y, Direction.X);
tracer.Position = UDim2.fromOffset(Center.X, Center.Y);
tracer.Rotation = math.deg(Theta);
tracer.Size = UDim2.fromOffset(Distance, 1);
LineProperties.To = To
end)))
coroutine.resume(coroutine.create((function()
local From = Vector2.new(cam.ViewportSize.X / 2, cam.ViewportSize.Y / 2)
local Direction = (LineProperties.To - From);
local Center = (LineProperties.To + From) / 2
local Distance = Direction.Magnitude
local Theta = math.atan2(Direction.Y, Direction.X);
tracer.Position = UDim2.fromOffset(Center.X, Center.Y);
tracer.Rotation = math.deg(Theta);
tracer.Size = UDim2.fromOffset(Distance, 1);
LineProperties.From = From
end)))
end)
Why don’t you borrow some code from some exploits? It’s all open source and free to use.
assert(Drawing, 'exploit not supported')
if not syn and not PROTOSMASHER_LOADED then print'Unnamed ESP only officially supports Synapse and Protosmasher! If you\'re an exploit developer and have added drawing API to your exploit, try setting syn as true then checking if that works, otherwise, DM me on discord @ cppbook.org#1968 or add an issue to the Unnamed ESP Github Repository and I\'ll see it through email!' end
local UserInputService = game:GetService'UserInputService';
local HttpService = game:GetService'HttpService';
local GUIService = game:GetService'GuiService';
local TweenService = game:GetService'TweenService';
local RunService = game:GetService'RunService';
local Players = game:GetService'Players';
local LocalPlayer = Players.LocalPlayer;
local Camera = workspace.CurrentCamera;
local Mouse = LocalPlayer:GetMouse();
local V2New = Vector2.new;
local V3New = Vector3.new;
local WTVP = Camera.WorldToViewportPoint;
local WorldToViewport = function(...) return WTVP(Camera, ...) end;
local Menu = {};
local MouseHeld = false;
local LastRefresh = 0;
This file has been truncated. show original
zqozr_II
(duckling)
September 9, 2022, 6:43am
#3
That is a good idea, although “Drawing” is what I need, which I’m looking for the source code of it, I checked the script and it uses synapse Drawing api which I don’t have the source code of
The drawing library itself is not what you are looking for. Try finding the code that positions the lines and rotates them.
kylerzong
(kylerzong)
September 9, 2022, 7:20am
#5
LocalScript → StarterPlayerScripts
local TargetPartName = "HumanoidRootPart"
local GenericHumanoidTargetPartName = TargetPartName
local LineColor = Color3.new(255, 255, 255)
local TeammateLineColor = Color3.new(0, 0.25, 1)
local GenericHumanoidLineColor = Color3.new(1, 0, 0)
local LineWidth = 2
local DrawTeammates = true
local FindHumanoids = true
local GetLineOrigin = function(Camera)
return Vector2.new(Camera.ViewportSize.X/2, Camera.ViewportSize.Y*.9)
end
local Camera = workspace.Curre…
Offset solved by changing anchor point and reacting to screen size changes