Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
- local Window = Rayfield:CreateWindow({
- Name = "☠️ Xaltxz Free V1 ☠️",
- LoadingTitle = "Trident Survival V4",
- LoadingSubtitle = "by Draffs",
- ConfigurationSaving = {
- Enabled = false,
- FolderName = xal, -- Create a custom folder for your hub/game
- FileName = "Xaltxz"
- },
- Discord = {
- Enabled = false,
- Invite = "prueba2", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD
- RememberJoins = true -- Set this to false to make them join the discord every time they load it up
- },
- KeySystem = false, -- Set this to true to use our key system
- KeySettings = {
- Title = "Xaltxz Free V1 | Key",
- Subtitle = "",
- Note = "Join the discord server for the key",
- FileName = "xaltxzkeysecret", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
- SaveKey = false, -- The user's key will be saved, but if you change the key, they will be unable to use your script
- GrabKeyFromSite = true, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
- Key = {"https://[Log in to view URL]"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22")
- }
- })
- local MiscTab = Window:CreateTab("⚔️Misc", xal) -- Title, Image
- local Section = MiscTab:CreateSection("Misc")
- Rayfield:Notify({
- Title = "You executed the script Xaltxz V1",
- Content = "Welcome!",
- Duration = 5,
- Image = xal,
- Actions = {},
- })
- -- Definición de BoxESP
- local BoxESP = {}
- function BoxESP.Create(Player)
- local Box = Drawing.new("Square")
- Box.Visible = false
- Box.Color = Color3.fromRGB(194, 17, 17)
- Box.Filled = false
- Box.Transparency = 0.50
- Box.Thickness = 2
- local DistanceLabel = Drawing.new("Text")
- DistanceLabel.Visible = false
- DistanceLabel.Size = 12
- DistanceLabel.Color = Color3.fromRGB(202, 37, 37) -- Color blanco para el texto
- DistanceLabel.Center = true
- DistanceLabel.Outline = true
- local Updater
- local function UpdateBox()
- if Player and Player:IsA("Model") and Player:FindFirstChild("HumanoidRootPart") and Player:FindFirstChild("Head") then
- local HumanoidRootPart = Player.HumanoidRootPart
- local Head = Player.Head
- local Camera = workspace.CurrentCamera
- -- Calcular la distancia
- local Distance = (Camera.CFrame.p - HumanoidRootPart.Position).magnitude
- local DistanceText = string.format("%.1f m", Distance)
- -- Actualizar la caja y el texto de distancia
- local Target2dPosition, IsVisible = Camera:WorldToViewportPoint(HumanoidRootPart.Position)
- local scale_factor = 1 / (Target2dPosition.Z * math.tan(math.rad(Camera.FieldOfView * 0.5)) * 2) * 100
- local width, height = math.floor(40 * scale_factor), math.floor(62 * scale_factor)
- Box.Visible = IsVisible
- Box.Size = Vector2.new(width, height)
- Box.Position = Vector2.new(Target2dPosition.X - Box.Size.X / 2, Target2dPosition.Y - Box.Size.Y / 2)
- DistanceLabel.Visible = IsVisible
- DistanceLabel.Position = Vector2.new(Target2dPosition.X, Target2dPosition.Y + Box.Size.Y / 2 + 10)
- DistanceLabel.Text = DistanceText
- else
- Box.Visible = false
- DistanceLabel.Visible = false
- if not Player then
- Box:Remove()
- DistanceLabel:Remove()
- Updater:Disconnect()
- end
- end
- end
- Updater = game:GetService("RunService").RenderStepped:Connect(UpdateBox)
- return Box, DistanceLabel
- end
- local Boxes = {}
- local function EnableBoxESP()
- for _, Player in pairs(game:GetService("Workspace"):GetChildren()) do
- if Player:IsA("Model") and Player:FindFirstChild("HumanoidRootPart") and Player:FindFirstChild("Head") then
- local Box, DistanceLabel = BoxESP.Create(Player)
- table.insert(Boxes, {Box = Box, DistanceLabel = DistanceLabel})
- end
- end
- end
- game.Workspace.DescendantAdded:Connect(function(i)
- if i:IsA("Model") and i:FindFirstChild("HumanoidRootPart") and i:FindFirstChild("Head") then
- local Box, DistanceLabel = BoxESP.Create(i)
- table.insert(Boxes, {Box = Box, DistanceLabel = DistanceLabel})
- end
- end)
- -- Función para desactivar BoxESP
- local function DisableBoxESP()
- for _, BoxData in pairs(Boxes) do
- BoxData.Box:Remove()
- BoxData.DistanceLabel:Remove()
- end
- Boxes = {}
- end
- -- Creación del Toggle
- local Toggle = MiscTab:CreateToggle({
- Name = "Toggle BoxESP",
- CurrentValue = false,
- Flag = "ToggleBoxESP",
- Callback = function(Value)
- if Value then
- EnableBoxESP()
- else
- DisableBoxESP()
- end
- end,
- })
- local SelectPart = "Head"
- local HBSizeX = 4
- local HBSizeY = 8
- local HBSizeZ = 4
- local SelectedColor = BrickColor.new("Bright violet")
- local hitboxlist = {}
- local toggleEnabled = false -- Variable para el estado del toggle
- local function createHitbox(parent)
- local FakeHead = Instance.new("Part", parent)
- FakeHead.CFrame = parent.HumanoidRootPart.CFrame
- FakeHead.Name = SelectPart
- FakeHead.Size = Vector3.new(HBSizeX, HBSizeY, HBSizeZ)
- FakeHead.Anchored = true
- FakeHead.CanCollide = false
- FakeHead.Transparency = 0.5 -- Valor de transparencia fijo
- FakeHead.BrickColor = SelectedColor -- Aplica el color a la hitbox
- local subndom = Instance.new("Part", parent)
- subndom.Name = "Fake"
- table.insert(hitboxlist, FakeHead)
- table.insert(hitboxlist, subndom)
- end
- local function clearHitboxes()
- for _, hitbox in ipairs(hitboxlist) do
- hitbox:Destroy()
- end
- hitboxlist = {}
- end
- local function toggleHitboxes()
- if #hitboxlist > 0 then
- -- Limpiar todas las hitboxes si ya existen
- clearHitboxes()
- else
- -- Crear hitboxes para cada humanoid en el workspace
- for _, instance in pairs(workspace:GetChildren()) do
- if instance:IsA("Model") and instance:FindFirstChild("HumanoidRootPart") and not instance:FindFirstChild("Fake") then
- createHitbox(instance)
- end
- end
- end
- end
- -- Función para actualizar el tamaño de la hitbox
- local function updateHitboxSize(x, y, z)
- -- Aplicar límites
- x = math.clamp(x, 1, 9)
- y = math.clamp(y, 1, 10)
- z = math.clamp(z, 1, 9)
- -- Actualizar tamaños
- HBSizeX = x
- HBSizeY = y
- HBSizeZ = z
- -- Actualizar las hitboxes existentes si están activadas
- if toggleEnabled then
- toggleHitboxes() -- Limpiar y recrear hitboxes con los nuevos tamaños
- end
- end
- -- Función para actualizar el color de las hitboxes
- local function updateHitboxColor(color)
- SelectedColor = color
- -- Actualizar el color de todas las hitboxes creadas
- for _, hitbox in ipairs(hitboxlist) do
- if hitbox.Name == SelectPart then
- hitbox.BrickColor = color
- end
- end
- end
- -- Función para activar/desactivar las hitboxes cuando se presione un botón
- local ToggleButton = MiscTab:CreateToggle({
- Name = "Toggle Hitboxes",
- CurrentValue = false,
- Flag = "ToggleHitboxesFlag", -- Asegúrate de usar una bandera única si estás guardando la configuración
- Callback = function(Value)
- toggleHitboxes()
- end,
- })
- -- Crear el Color Picker para la hitbox
- local HitboxColorPicker = MiscTab:CreateColorPicker({
- Name = "Hitbox Color",
- Color = SelectedColor.Color,
- Flag = "HitboxColorFlag",
- Callback = function(newColor)
- updateHitboxColor(BrickColor.new(newColor))
- end,
- })
- -- Crear los inputs para los tamaños de la hitbox
- local SizeInputs = {
- X = MiscTab:CreateInput({
- Name = "Size X (1-9)",
- PlaceholderText = tostring(HBSizeX),
- AllowSpaces = false,
- Numeric = true,
- MinValue = 1,
- MaxValue = 9,
- Callback = function(text)
- local value = tonumber(text)
- if value then
- updateHitboxSize(value, HBSizeY, HBSizeZ)
- end
- end,
- }),
- Y = MiscTab:CreateInput({
- Name = "Size Y (1-10)",
- PlaceholderText = tostring(HBSizeY),
- AllowSpaces = false,
- Numeric = true,
- MinValue = 1,
- MaxValue = 10,
- Callback = function(text)
- local value = tonumber(text)
- if value then
- updateHitboxSize(HBSizeX, value, HBSizeZ)
- end
- end,
- }),
- Z = MiscTab:CreateInput({
- Name = "Size Z (1-9)",
- PlaceholderText = tostring(HBSizeZ),
- AllowSpaces = false,
- Numeric = true,
- MinValue = 1,
- MaxValue = 9,
- Callback = function(text)
- local value = tonumber(text)
- if value then
- updateHitboxSize(HBSizeX, HBSizeY, value)
- end
- end,
- }),
- }
- 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"))
- LocalScript0 = Instance.new("LocalScript")
- LocalScript0.Name = "FreeCamera"
- LocalScript0.Parent = mas
- table.insert(cors,sandbox(LocalScript0,function()
- local pi = math.pi
- local abs = math.abs
- local clamp = math.clamp
- local exp = math.exp
- local rad = math.rad
- local sign = math.sign
- local sqrt = math.sqrt
- local tan = math.tan
- local ContextActionService = game:GetService("ContextActionService")
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local StarterGui = game:GetService("StarterGui")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- if not LocalPlayer then
- Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
- LocalPlayer = Players.LocalPlayer
- end
- local Camera = workspace.CurrentCamera
- workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
- local newCamera = workspace.CurrentCamera
- if newCamera then
- Camera = newCamera
- end
- end)
- local TOGGLE_INPUT_PRIORITY = Enum.ContextActionPriority.Low.Value
- local INPUT_PRIORITY = Enum.ContextActionPriority.High.Value
- local FREECAM_MACRO_KB = {Enum.KeyCode.LeftShift, Enum.KeyCode.P}
- local NAV_GAIN = Vector3.new(1, 1, 1)*64
- local PAN_GAIN = Vector2.new(0.75, 1)*8
- local FOV_GAIN = 300
- local PITCH_LIMIT = rad(90)
- local VEL_STIFFNESS = 1.5
- local PAN_STIFFNESS = 1.0
- local FOV_STIFFNESS = 4.0
- local Spring = {} do
- Spring.__index = Spring
- function Spring.new(freq, pos)
- local self = setmetatable({}, Spring)
- self.f = freq
- self.p = pos
- self.v = pos*0
- return self
- end
- function Spring:Update(dt, goal)
- local f = self.f*2*pi
- local p0 = self.p
- local v0 = self.v
- local offset = goal - p0
- local decay = exp(-f*dt)
- local p1 = goal + (v0*dt - offset*(f*dt + 1))*decay
- local v1 = (f*dt*(offset*f - v0) + v0)*decay
- self.p = p1
- self.v = v1
- return p1
- end
- function Spring:Reset(pos)
- self.p = pos
- self.v = pos*0
- end
- end
- local cameraPos = Vector3.new()
- local cameraRot = Vector2.new()
- local cameraFov = 0
- local velSpring = Spring.new(VEL_STIFFNESS, Vector3.new())
- local panSpring = Spring.new(PAN_STIFFNESS, Vector2.new())
- local fovSpring = Spring.new(FOV_STIFFNESS, 0)
- local Input = {} do
- local thumbstickCurve do
- local K_CURVATURE = 2.0
- local K_DEADZONE = 0.15
- local function fCurve(x)
- return (exp(K_CURVATURE*x) - 1)/(exp(K_CURVATURE) - 1)
- end
- local function fDeadzone(x)
- return fCurve((x - K_DEADZONE)/(1 - K_DEADZONE))
- end
- function thumbstickCurve(x)
- return sign(x)*clamp(fDeadzone(abs(x)), 0, 1)
- end
- end
- local gamepad = {
- ButtonX = 0,
- ButtonY = 0,
- DPadDown = 0,
- DPadUp = 0,
- ButtonL2 = 0,
- ButtonR2 = 0,
- Thumbstick1 = Vector2.new(),
- Thumbstick2 = Vector2.new(),
- }
- local keyboard = {
- W = 0,
- A = 0,
- S = 0,
- D = 0,
- E = 0,
- Q = 0,
- U = 0,
- H = 0,
- J = 0,
- K = 0,
- I = 0,
- Y = 0,
- Up = 0,
- Down = 0,
- LeftShift = 0,
- RightShift = 0,
- }
- local mouse = {
- Delta = Vector2.new(),
- MouseWheel = 0,
- }
- local NAV_GAMEPAD_SPEED = Vector3.new(1, 1, 1)
- local NAV_KEYBOARD_SPEED = Vector3.new(1, 1, 1)
- local PAN_MOUSE_SPEED = Vector2.new(1, 1)*(pi/64)
- local PAN_GAMEPAD_SPEED = Vector2.new(1, 1)*(pi/8)
- local FOV_WHEEL_SPEED = 1.0
- local FOV_GAMEPAD_SPEED = 0.25
- local NAV_ADJ_SPEED = 0.75
- local NAV_SHIFT_MUL = 0.25
- local navSpeed = 1
- function Input.Vel(dt)
- navSpeed = clamp(navSpeed + dt*(keyboard.Up - keyboard.Down)*NAV_ADJ_SPEED, 0.01, 4)
- local kGamepad = Vector3.new(
- thumbstickCurve(gamepad.Thumbstick1.x),
- thumbstickCurve(gamepad.ButtonR2) - thumbstickCurve(gamepad.ButtonL2),
- thumbstickCurve(-gamepad.Thumbstick1.y)
- )*NAV_GAMEPAD_SPEED
- local kKeyboard = Vector3.new(
- keyboard.D - keyboard.A + keyboard.K - keyboard.H,
- keyboard.E - keyboard.Q + keyboard.I - keyboard.Y,
- keyboard.S - keyboard.W + keyboard.J - keyboard.U
- )*NAV_KEYBOARD_SPEED
- local shift = UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift)
- return (kGamepad + kKeyboard)*(navSpeed*(shift and NAV_SHIFT_MUL or 1))
- end
- function Input.Pan(dt)
- local kGamepad = Vector2.new(
- thumbstickCurve(gamepad.Thumbstick2.y),
- thumbstickCurve(-gamepad.Thumbstick2.x)
- )*PAN_GAMEPAD_SPEED
- local kMouse = mouse.Delta*PAN_MOUSE_SPEED
- mouse.Delta = Vector2.new()
- return kGamepad + kMouse
- end
- function Input.Fov(dt)
- local kGamepad = (gamepad.ButtonX - gamepad.ButtonY)*FOV_GAMEPAD_SPEED
- local kMouse = mouse.MouseWheel*FOV_WHEEL_SPEED
- mouse.MouseWheel = 0
- return kGamepad + kMouse
- end
- do
- local function Keypress(action, state, input)
- keyboard[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
- return Enum.ContextActionResult.Sink
- end
- local function GpButton(action, state, input)
- gamepad[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
- return Enum.ContextActionResult.Sink
- end
- local function MousePan(action, state, input)
- local delta = input.Delta
- mouse.Delta = Vector2.new(-delta.y, -delta.x)
- return Enum.ContextActionResult.Sink
- end
- local function Thumb(action, state, input)
- gamepad[input.KeyCode.Name] = input.Position
- return Enum.ContextActionResult.Sink
- end
- local function Trigger(action, state, input)
- gamepad[input.KeyCode.Name] = input.Position.z
- return Enum.ContextActionResult.Sink
- end
- local function MouseWheel(action, state, input)
- mouse[input.UserInputType.Name] = -input.Position.z
- return Enum.ContextActionResult.Sink
- end
- local function Zero(t)
- for k, v in pairs(t) do
- t[k] = v*0
- end
- end
- function Input.StartCapture()
- ContextActionService:BindActionAtPriority("FreecamKeyboard", Keypress, false, INPUT_PRIORITY,
- Enum.KeyCode.W, Enum.KeyCode.U,
- Enum.KeyCode.A, Enum.KeyCode.H,
- Enum.KeyCode.S, Enum.KeyCode.J,
- Enum.KeyCode.D, Enum.KeyCode.K,
- Enum.KeyCode.E, Enum.KeyCode.I,
- Enum.KeyCode.Q, Enum.KeyCode.Y,
- Enum.KeyCode.Up, Enum.KeyCode.Down
- )
- ContextActionService:BindActionAtPriority("FreecamMousePan", MousePan, false, INPUT_PRIORITY, Enum.UserInputType.MouseMovement)
- ContextActionService:BindActionAtPriority("FreecamMouseWheel", MouseWheel, false, INPUT_PRIORITY, Enum.UserInputType.MouseWheel)
- ContextActionService:BindActionAtPriority("FreecamGamepadButton", GpButton, false, INPUT_PRIORITY, Enum.KeyCode.ButtonX, Enum.KeyCode.ButtonY)
- ContextActionService:BindActionAtPriority("FreecamGamepadTrigger", Trigger, false, INPUT_PRIORITY, Enum.KeyCode.ButtonR2, Enum.KeyCode.ButtonL2)
- ContextActionService:BindActionAtPriority("FreecamGamepadThumbstick", Thumb, false, INPUT_PRIORITY, Enum.KeyCode.Thumbstick1, Enum.KeyCode.Thumbstick2)
- end
- function Input.StopCapture()
- navSpeed = 1
- Zero(gamepad)
- Zero(keyboard)
- Zero(mouse)
- ContextActionService:UnbindAction("FreecamKeyboard")
- ContextActionService:UnbindAction("FreecamMousePan")
- ContextActionService:UnbindAction("FreecamMouseWheel")
- ContextActionService:UnbindAction("FreecamGamepadButton")
- ContextActionService:UnbindAction("FreecamGamepadTrigger")
- ContextActionService:UnbindAction("FreecamGamepadThumbstick")
- end
- end
- end
- local function GetFocusDistance(cameraFrame)
- local znear = 0.1
- local viewport = Camera.ViewportSize
- local projy = 2*tan(cameraFov/2)
- local projx = viewport.x/viewport.y*projy
- local fx = cameraFrame.rightVector
- local fy = cameraFrame.upVector
- local fz = cameraFrame.lookVector
- local minVect = Vector3.new()
- local minDist = 512
- for x = 0, 1, 0.5 do
- for y = 0, 1, 0.5 do
- local cx = (x - 0.5)*projx
- local cy = (y - 0.5)*projy
- local offset = fx*cx - fy*cy + fz
- local origin = cameraFrame.p + offset*znear
- local part, hit = workspace:FindPartOnRay(Ray.new(origin, offset.unit*minDist))
- local dist = (hit - origin).magnitude
- if minDist > dist then
- minDist = dist
- minVect = offset.unit
- end
- end
- end
- return fz:Dot(minVect)*minDist
- end
- local function StepFreecam(dt)
- local vel = velSpring:Update(dt, Input.Vel(dt))
- local pan = panSpring:Update(dt, Input.Pan(dt))
- local fov = fovSpring:Update(dt, Input.Fov(dt))
- local zoomFactor = sqrt(tan(rad(70/2))/tan(rad(cameraFov/2)))
- cameraFov = clamp(cameraFov + fov*FOV_GAIN*(dt/zoomFactor), 1, 120)
- cameraRot = cameraRot + pan*PAN_GAIN*(dt/zoomFactor)
- cameraRot = Vector2.new(clamp(cameraRot.x, -PITCH_LIMIT, PITCH_LIMIT), cameraRot.y%(2*pi))
- local cameraCFrame = CFrame.new(cameraPos)*CFrame.fromOrientation(cameraRot.x, cameraRot.y, 0)*CFrame.new(vel*NAV_GAIN*dt)
- cameraPos = cameraCFrame.p
- Camera.CFrame = cameraCFrame
- Camera.Focus = cameraCFrame*CFrame.new(0, 0, -GetFocusDistance(cameraCFrame))
- Camera.FieldOfView = cameraFov
- end
- local PlayerState = {} do
- local mouseIconEnabled
- local cameraSubject
- local cameraType
- local cameraFocus
- local cameraCFrame
- local cameraFieldOfView
- local screenGuis = {}
- local coreGuis = {
- Backpack = true,
- Chat = true,
- Health = true,
- PlayerList = true,
- }
- local setCores = {
- BadgesNotificationsActive = true,
- PointsNotificationsActive = true,
- }
- function PlayerState.Push()
- for name in pairs(coreGuis) do
- coreGuis[name] = StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType[name])
- StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType[name], false)
- end
- for name in pairs(setCores) do
- setCores[name] = StarterGui:GetCore(name)
- StarterGui:SetCore(name, false)
- end
- local playergui = LocalPlayer:FindFirstChildOfClass("PlayerGui")
- if playergui then
- for _, gui in pairs(playergui:GetChildren()) do
- if gui:IsA("ScreenGui") and gui.Enabled then
- screenGuis[#screenGuis + 1] = gui
- gui.Enabled = false
- end
- end
- end
- cameraFieldOfView = Camera.FieldOfView
- Camera.FieldOfView = 70
- cameraType = Camera.CameraType
- Camera.CameraType = Enum.CameraType.Custom
- cameraSubject = Camera.CameraSubject
- Camera.CameraSubject = nil
- cameraCFrame = Camera.CFrame
- cameraFocus = Camera.Focus
- mouseIconEnabled = UserInputService.MouseIconEnabled
- UserInputService.MouseIconEnabled = false
- mouseBehavior = UserInputService.MouseBehavior
- UserInputService.MouseBehavior = Enum.MouseBehavior.Default
- end
- -- Restore state
- function PlayerState.Pop()
- for name, isEnabled in pairs(coreGuis) do
- StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType[name], isEnabled)
- end
- for name, isEnabled in pairs(setCores) do
- StarterGui:SetCore(name, isEnabled)
- end
- for _, gui in pairs(screenGuis) do
- if gui.Parent then
- gui.Enabled = true
- end
- end
- Camera.FieldOfView = cameraFieldOfView
- cameraFieldOfView = nil
- Camera.CameraType = cameraType
- cameraType = nil
- Camera.CameraSubject = cameraSubject
- cameraSubject = nil
- Camera.CFrame = cameraCFrame
- cameraCFrame = nil
- Camera.Focus = cameraFocus
- cameraFocus = nil
- UserInputService.MouseIconEnabled = mouseIconEnabled
- mouseIconEnabled = nil
- UserInputService.MouseBehavior = mouseBehavior
- mouseBehavior = nil
- end
- end
- local function StartFreecam()
- local cameraCFrame = Camera.CFrame
- cameraRot = Vector2.new(cameraCFrame:toEulerAnglesYXZ())
- cameraPos = cameraCFrame.p
- cameraFov = Camera.FieldOfView
- velSpring:Reset(Vector3.new())
- panSpring:Reset(Vector2.new())
- fovSpring:Reset(0)
- PlayerState.Push()
- RunService:BindToRenderStep("Freecam", Enum.RenderPriority.Camera.Value, StepFreecam)
- Input.StartCapture()
- end
- local function StopFreecam()
- Input.StopCapture()
- RunService:UnbindFromRenderStep("Freecam")
- PlayerState.Pop()
- end
- do
- local enabled = false
- local function ToggleFreecam()
- if enabled then
- StopFreecam()
- else
- StartFreecam()
- end
- enabled = not enabled
- end
- local function CheckMacro(macro)
- for i = 1, #macro - 1 do
- if not UserInputService:IsKeyDown(macro[i]) then
- return
- end
- end
- ToggleFreecam()
- end
- local function HandleActivationInput(action, state, input)
- if state == Enum.UserInputState.Begin then
- if input.KeyCode == FREECAM_MACRO_KB[#FREECAM_MACRO_KB] then
- CheckMacro(FREECAM_MACRO_KB)
- end
- end
- return Enum.ContextActionResult.Pass
- end
- ContextActionService:BindActionAtPriority("FreecamToggle", HandleActivationInput, false, TOGGLE_INPUT_PRIORITY, FREECAM_MACRO_KB[#FREECAM_MACRO_KB])
- end
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.PlayerGui
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- print ("Freecam LOADED")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- local Camera = workspace.CurrentCamera
- local FOV_CIRCLE = Drawing.new("Circle")
- FOV_CIRCLE.Visible = false
- FOV_CIRCLE.Filled = false
- FOV_CIRCLE.Thickness = 1
- FOV_CIRCLE.Transparency = 1
- FOV_CIRCLE.Color = Color3.new(0, 1, 0)
- FOV_CIRCLE.Radius = 80 -- Change this value to adjust the radius of the circle.
- local function MoveFovCircle()
- pcall(function()
- local DoIt = true
- spawn(function()
- while DoIt do
- task.wait()
- FOV_CIRCLE.Position = Vector2.new(Mouse.X, (Mouse.Y + 36))
- end
- end)
- end)
- end
- coroutine.wrap(MoveFovCircle)()
- print ("Forcircle LOADED")
- settings = {
- color = Color3.fromRGB(255, 0/2, 0), -- The color of the crosshair, takes any Color3.
- thickness = 2, -- The thickness of the crosshair in pixel, takes any full number.
- length = 5, -- The length of each side in pixel, takes any full number.
- opacity = 1, -- The opacity of the crosshair, takes any number, 1 is fully visible and 0 is invisible.
- x_offset = 0, -- The x offset of the crosshair, takes any positive or negative number.
- y_offset = 0, -- The y offset of the crosshair, takes any positive or negative number.
- recenter = true -- Automatically recenter the crosshair if your window was resized, this is an option in case it causes lag for anyone which I highly doubt, if it does for you, then please stop using your Microwave for Roblox.
- }
- local cam = workspace.CurrentCamera or workspace:FindFirstChildOfClass("Camera")
- getgenv().crosshair_x = getgenv().crosshair_x or {}
- getgenv().crosshair_y = getgenv().crosshair_y or {}
- local function draw(a1, a2)
- local obj = Drawing.new(a1)
- for i, v in pairs(a2) do
- obj[i] = v
- end
- return obj
- end
- if getgenv().crosshair_x ~= nil or getgenv().crosshair_x ~= {} then
- if getgenv().crosshair_x["Line"] then
- getgenv().crosshair_x["Line"]:Remove()
- end
- if getgenv().crosshair_x["Connection"]
- then
- getgenv().crosshair_x["Connection"]:Disconnect()
- end
- getgenv().crosshair_x = {}
- end
- if getgenv().crosshair_y ~= nil or getgenv().crosshair_y ~= {} then
- if getgenv().crosshair_y["Line"] then
- getgenv().crosshair_y["Line"]:Remove()
- end
- if getgenv().crosshair_y["Connection"] then
- getgenv().crosshair_y["Connection"]:Disconnect()
- end
- getgenv().crosshair_y = {}
- end
- getgenv().crosshair_x["Line"] = draw("Line", {
- To = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) - settings.length, (cam.ViewportSize.y / 2) - settings.y_offset),
- From = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) + settings.length, (cam.ViewportSize.y / 2) - settings.y_offset),
- Thickness = settings.thickness,
- Color = settings.color,
- Transparency = settings.opacity,
- Visible = true
- })
- getgenv().crosshair_y["Line"] = draw("Line", {
- To = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) - settings.length),
- From = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) + settings.length),
- Thickness = settings.thickness,
- Color = settings.color,
- Transparency = settings.opacity,
- Visible = true
- })
- if settings.recenter then
- getgenv().crosshair_x["Connection"] = cam:GetPropertyChangedSignal("ViewportSize"):Connect(function()
- getgenv().crosshair_x["Line"]["To"] = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) - settings.length, (cam.ViewportSize.y / 2) - settings.y_offset)
- getgenv().crosshair_x["Line"]["From"] = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) + settings.length, (cam.ViewportSize.y / 2) - settings.y_offset)
- end)
- getgenv().crosshair_y["Connection"] = cam:GetPropertyChangedSignal("ViewportSize"):Connect(function()
- getgenv().crosshair_y["Line"]["To"] = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) - settings.length)
- getgenv().crosshair_y["Line"]["From"] = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) + settings.length)
- end)
- end
Advertisement
Advertisement