Advertisement
Guest User

Trident

a guest
Jul 25th, 2024
5,778
2
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.15 KB | None | 2 0
  1. local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  2.  
  3. local Window = Rayfield:CreateWindow({
  4. Name = "☠️ Xaltxz Free V1 ☠️",
  5. LoadingTitle = "Trident Survival V4",
  6. LoadingSubtitle = "by Draffs",
  7. ConfigurationSaving = {
  8. Enabled = false,
  9. FolderName = xal, -- Create a custom folder for your hub/game
  10. FileName = "Xaltxz"
  11. },
  12. Discord = {
  13. Enabled = false,
  14. Invite = "prueba2", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD
  15. RememberJoins = true -- Set this to false to make them join the discord every time they load it up
  16. },
  17. KeySystem = false, -- Set this to true to use our key system
  18. KeySettings = {
  19. Title = "Xaltxz Free V1 | Key",
  20. Subtitle = "",
  21. Note = "Join the discord server for the key",
  22. FileName = "xaltxzkeysecret", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
  23. SaveKey = false, -- The user's key will be saved, but if you change the key, they will be unable to use your script
  24. GrabKeyFromSite = true, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
  25. 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")
  26. }
  27. })
  28.  
  29. local MiscTab = Window:CreateTab("⚔️Misc", xal) -- Title, Image
  30. local Section = MiscTab:CreateSection("Misc")
  31.  
  32. Rayfield:Notify({
  33. Title = "You executed the script Xaltxz V1",
  34. Content = "Welcome!",
  35. Duration = 5,
  36. Image = xal,
  37. Actions = {},
  38. })
  39.  
  40. -- Definición de BoxESP
  41. local BoxESP = {}
  42. function BoxESP.Create(Player)
  43. local Box = Drawing.new("Square")
  44. Box.Visible = false
  45. Box.Color = Color3.fromRGB(194, 17, 17)
  46. Box.Filled = false
  47. Box.Transparency = 0.50
  48. Box.Thickness = 2
  49.  
  50. local DistanceLabel = Drawing.new("Text")
  51. DistanceLabel.Visible = false
  52. DistanceLabel.Size = 12
  53. DistanceLabel.Color = Color3.fromRGB(202, 37, 37) -- Color blanco para el texto
  54. DistanceLabel.Center = true
  55. DistanceLabel.Outline = true
  56.  
  57. local Updater
  58.  
  59. local function UpdateBox()
  60. if Player and Player:IsA("Model") and Player:FindFirstChild("HumanoidRootPart") and Player:FindFirstChild("Head") then
  61. local HumanoidRootPart = Player.HumanoidRootPart
  62. local Head = Player.Head
  63. local Camera = workspace.CurrentCamera
  64.  
  65. -- Calcular la distancia
  66. local Distance = (Camera.CFrame.p - HumanoidRootPart.Position).magnitude
  67. local DistanceText = string.format("%.1f m", Distance)
  68.  
  69. -- Actualizar la caja y el texto de distancia
  70. local Target2dPosition, IsVisible = Camera:WorldToViewportPoint(HumanoidRootPart.Position)
  71. local scale_factor = 1 / (Target2dPosition.Z * math.tan(math.rad(Camera.FieldOfView * 0.5)) * 2) * 100
  72. local width, height = math.floor(40 * scale_factor), math.floor(62 * scale_factor)
  73.  
  74. Box.Visible = IsVisible
  75. Box.Size = Vector2.new(width, height)
  76. Box.Position = Vector2.new(Target2dPosition.X - Box.Size.X / 2, Target2dPosition.Y - Box.Size.Y / 2)
  77.  
  78. DistanceLabel.Visible = IsVisible
  79. DistanceLabel.Position = Vector2.new(Target2dPosition.X, Target2dPosition.Y + Box.Size.Y / 2 + 10)
  80. DistanceLabel.Text = DistanceText
  81. else
  82. Box.Visible = false
  83. DistanceLabel.Visible = false
  84. if not Player then
  85. Box:Remove()
  86. DistanceLabel:Remove()
  87. Updater:Disconnect()
  88. end
  89. end
  90. end
  91.  
  92. Updater = game:GetService("RunService").RenderStepped:Connect(UpdateBox)
  93.  
  94. return Box, DistanceLabel
  95. end
  96.  
  97. local Boxes = {}
  98.  
  99. local function EnableBoxESP()
  100. for _, Player in pairs(game:GetService("Workspace"):GetChildren()) do
  101. if Player:IsA("Model") and Player:FindFirstChild("HumanoidRootPart") and Player:FindFirstChild("Head") then
  102. local Box, DistanceLabel = BoxESP.Create(Player)
  103. table.insert(Boxes, {Box = Box, DistanceLabel = DistanceLabel})
  104. end
  105. end
  106. end
  107.  
  108. game.Workspace.DescendantAdded:Connect(function(i)
  109. if i:IsA("Model") and i:FindFirstChild("HumanoidRootPart") and i:FindFirstChild("Head") then
  110. local Box, DistanceLabel = BoxESP.Create(i)
  111. table.insert(Boxes, {Box = Box, DistanceLabel = DistanceLabel})
  112. end
  113. end)
  114.  
  115. -- Función para desactivar BoxESP
  116. local function DisableBoxESP()
  117. for _, BoxData in pairs(Boxes) do
  118. BoxData.Box:Remove()
  119. BoxData.DistanceLabel:Remove()
  120. end
  121. Boxes = {}
  122. end
  123.  
  124. -- Creación del Toggle
  125. local Toggle = MiscTab:CreateToggle({
  126. Name = "Toggle BoxESP",
  127. CurrentValue = false,
  128. Flag = "ToggleBoxESP",
  129. Callback = function(Value)
  130. if Value then
  131. EnableBoxESP()
  132. else
  133. DisableBoxESP()
  134. end
  135. end,
  136. })
  137.  
  138.  
  139.  
  140. local SelectPart = "Head"
  141. local HBSizeX = 4
  142. local HBSizeY = 8
  143. local HBSizeZ = 4
  144.  
  145. local SelectedColor = BrickColor.new("Bright violet")
  146.  
  147. local hitboxlist = {}
  148. local toggleEnabled = false -- Variable para el estado del toggle
  149.  
  150. local function createHitbox(parent)
  151. local FakeHead = Instance.new("Part", parent)
  152. FakeHead.CFrame = parent.HumanoidRootPart.CFrame
  153. FakeHead.Name = SelectPart
  154. FakeHead.Size = Vector3.new(HBSizeX, HBSizeY, HBSizeZ)
  155. FakeHead.Anchored = true
  156. FakeHead.CanCollide = false
  157. FakeHead.Transparency = 0.5 -- Valor de transparencia fijo
  158. FakeHead.BrickColor = SelectedColor -- Aplica el color a la hitbox
  159. local subndom = Instance.new("Part", parent)
  160. subndom.Name = "Fake"
  161. table.insert(hitboxlist, FakeHead)
  162. table.insert(hitboxlist, subndom)
  163. end
  164.  
  165. local function clearHitboxes()
  166. for _, hitbox in ipairs(hitboxlist) do
  167. hitbox:Destroy()
  168. end
  169. hitboxlist = {}
  170. end
  171.  
  172. local function toggleHitboxes()
  173. if #hitboxlist > 0 then
  174. -- Limpiar todas las hitboxes si ya existen
  175. clearHitboxes()
  176. else
  177. -- Crear hitboxes para cada humanoid en el workspace
  178. for _, instance in pairs(workspace:GetChildren()) do
  179. if instance:IsA("Model") and instance:FindFirstChild("HumanoidRootPart") and not instance:FindFirstChild("Fake") then
  180. createHitbox(instance)
  181. end
  182. end
  183. end
  184. end
  185.  
  186. -- Función para actualizar el tamaño de la hitbox
  187. local function updateHitboxSize(x, y, z)
  188. -- Aplicar límites
  189. x = math.clamp(x, 1, 9)
  190. y = math.clamp(y, 1, 10)
  191. z = math.clamp(z, 1, 9)
  192.  
  193. -- Actualizar tamaños
  194. HBSizeX = x
  195. HBSizeY = y
  196. HBSizeZ = z
  197.  
  198. -- Actualizar las hitboxes existentes si están activadas
  199. if toggleEnabled then
  200. toggleHitboxes() -- Limpiar y recrear hitboxes con los nuevos tamaños
  201. end
  202. end
  203.  
  204. -- Función para actualizar el color de las hitboxes
  205. local function updateHitboxColor(color)
  206. SelectedColor = color
  207. -- Actualizar el color de todas las hitboxes creadas
  208. for _, hitbox in ipairs(hitboxlist) do
  209. if hitbox.Name == SelectPart then
  210. hitbox.BrickColor = color
  211. end
  212. end
  213. end
  214.  
  215.  
  216. -- Función para activar/desactivar las hitboxes cuando se presione un botón
  217. local ToggleButton = MiscTab:CreateToggle({
  218. Name = "Toggle Hitboxes",
  219. CurrentValue = false,
  220. Flag = "ToggleHitboxesFlag", -- Asegúrate de usar una bandera única si estás guardando la configuración
  221. Callback = function(Value)
  222. toggleHitboxes()
  223. end,
  224. })
  225.  
  226. -- Crear el Color Picker para la hitbox
  227. local HitboxColorPicker = MiscTab:CreateColorPicker({
  228. Name = "Hitbox Color",
  229. Color = SelectedColor.Color,
  230. Flag = "HitboxColorFlag",
  231. Callback = function(newColor)
  232. updateHitboxColor(BrickColor.new(newColor))
  233. end,
  234. })
  235.  
  236. -- Crear los inputs para los tamaños de la hitbox
  237. local SizeInputs = {
  238. X = MiscTab:CreateInput({
  239. Name = "Size X (1-9)",
  240. PlaceholderText = tostring(HBSizeX),
  241. AllowSpaces = false,
  242. Numeric = true,
  243. MinValue = 1,
  244. MaxValue = 9,
  245. Callback = function(text)
  246. local value = tonumber(text)
  247. if value then
  248. updateHitboxSize(value, HBSizeY, HBSizeZ)
  249. end
  250. end,
  251. }),
  252. Y = MiscTab:CreateInput({
  253. Name = "Size Y (1-10)",
  254. PlaceholderText = tostring(HBSizeY),
  255. AllowSpaces = false,
  256. Numeric = true,
  257. MinValue = 1,
  258. MaxValue = 10,
  259. Callback = function(text)
  260. local value = tonumber(text)
  261. if value then
  262. updateHitboxSize(HBSizeX, value, HBSizeZ)
  263. end
  264. end,
  265. }),
  266. Z = MiscTab:CreateInput({
  267. Name = "Size Z (1-9)",
  268. PlaceholderText = tostring(HBSizeZ),
  269. AllowSpaces = false,
  270. Numeric = true,
  271. MinValue = 1,
  272. MaxValue = 9,
  273. Callback = function(text)
  274. local value = tonumber(text)
  275. if value then
  276. updateHitboxSize(HBSizeX, HBSizeY, value)
  277. end
  278. end,
  279. }),
  280. }
  281.  
  282.  
  283. function sandbox(var,func)
  284. local env = getfenv(func)
  285. local newenv = setmetatable({},{
  286. __index = function(self,k)
  287. if k=="script" then
  288. return var
  289. else
  290. return env[k]
  291. end
  292. end,
  293. })
  294. setfenv(func,newenv)
  295. return func
  296. end
  297. cors = {}
  298. mas = Instance.new("Model",game:GetService("Lighting"))
  299. LocalScript0 = Instance.new("LocalScript")
  300. LocalScript0.Name = "FreeCamera"
  301. LocalScript0.Parent = mas
  302. table.insert(cors,sandbox(LocalScript0,function()
  303. local pi = math.pi
  304. local abs = math.abs
  305. local clamp = math.clamp
  306. local exp = math.exp
  307. local rad = math.rad
  308. local sign = math.sign
  309. local sqrt = math.sqrt
  310. local tan = math.tan
  311.  
  312. local ContextActionService = game:GetService("ContextActionService")
  313. local Players = game:GetService("Players")
  314. local RunService = game:GetService("RunService")
  315. local StarterGui = game:GetService("StarterGui")
  316. local UserInputService = game:GetService("UserInputService")
  317.  
  318. local LocalPlayer = Players.LocalPlayer
  319. if not LocalPlayer then
  320. Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
  321. LocalPlayer = Players.LocalPlayer
  322. end
  323.  
  324. local Camera = workspace.CurrentCamera
  325. workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
  326. local newCamera = workspace.CurrentCamera
  327. if newCamera then
  328. Camera = newCamera
  329. end
  330. end)
  331. local TOGGLE_INPUT_PRIORITY = Enum.ContextActionPriority.Low.Value
  332. local INPUT_PRIORITY = Enum.ContextActionPriority.High.Value
  333. local FREECAM_MACRO_KB = {Enum.KeyCode.LeftShift, Enum.KeyCode.P}
  334.  
  335. local NAV_GAIN = Vector3.new(1, 1, 1)*64
  336. local PAN_GAIN = Vector2.new(0.75, 1)*8
  337. local FOV_GAIN = 300
  338.  
  339. local PITCH_LIMIT = rad(90)
  340.  
  341. local VEL_STIFFNESS = 1.5
  342. local PAN_STIFFNESS = 1.0
  343. local FOV_STIFFNESS = 4.0
  344. local Spring = {} do
  345. Spring.__index = Spring
  346.  
  347. function Spring.new(freq, pos)
  348. local self = setmetatable({}, Spring)
  349. self.f = freq
  350. self.p = pos
  351. self.v = pos*0
  352. return self
  353. end
  354.  
  355. function Spring:Update(dt, goal)
  356. local f = self.f*2*pi
  357. local p0 = self.p
  358. local v0 = self.v
  359.  
  360. local offset = goal - p0
  361. local decay = exp(-f*dt)
  362.  
  363. local p1 = goal + (v0*dt - offset*(f*dt + 1))*decay
  364. local v1 = (f*dt*(offset*f - v0) + v0)*decay
  365.  
  366. self.p = p1
  367. self.v = v1
  368.  
  369. return p1
  370. end
  371.  
  372. function Spring:Reset(pos)
  373. self.p = pos
  374. self.v = pos*0
  375. end
  376. end
  377.  
  378.  
  379.  
  380. local cameraPos = Vector3.new()
  381. local cameraRot = Vector2.new()
  382. local cameraFov = 0
  383.  
  384. local velSpring = Spring.new(VEL_STIFFNESS, Vector3.new())
  385. local panSpring = Spring.new(PAN_STIFFNESS, Vector2.new())
  386. local fovSpring = Spring.new(FOV_STIFFNESS, 0)
  387.  
  388.  
  389. local Input = {} do
  390. local thumbstickCurve do
  391. local K_CURVATURE = 2.0
  392. local K_DEADZONE = 0.15
  393.  
  394. local function fCurve(x)
  395. return (exp(K_CURVATURE*x) - 1)/(exp(K_CURVATURE) - 1)
  396. end
  397.  
  398. local function fDeadzone(x)
  399. return fCurve((x - K_DEADZONE)/(1 - K_DEADZONE))
  400. end
  401.  
  402. function thumbstickCurve(x)
  403. return sign(x)*clamp(fDeadzone(abs(x)), 0, 1)
  404. end
  405. end
  406.  
  407. local gamepad = {
  408. ButtonX = 0,
  409. ButtonY = 0,
  410. DPadDown = 0,
  411. DPadUp = 0,
  412. ButtonL2 = 0,
  413. ButtonR2 = 0,
  414. Thumbstick1 = Vector2.new(),
  415. Thumbstick2 = Vector2.new(),
  416. }
  417.  
  418. local keyboard = {
  419. W = 0,
  420. A = 0,
  421. S = 0,
  422. D = 0,
  423. E = 0,
  424. Q = 0,
  425. U = 0,
  426. H = 0,
  427. J = 0,
  428. K = 0,
  429. I = 0,
  430. Y = 0,
  431. Up = 0,
  432. Down = 0,
  433. LeftShift = 0,
  434. RightShift = 0,
  435. }
  436.  
  437. local mouse = {
  438. Delta = Vector2.new(),
  439. MouseWheel = 0,
  440. }
  441.  
  442. local NAV_GAMEPAD_SPEED = Vector3.new(1, 1, 1)
  443. local NAV_KEYBOARD_SPEED = Vector3.new(1, 1, 1)
  444. local PAN_MOUSE_SPEED = Vector2.new(1, 1)*(pi/64)
  445. local PAN_GAMEPAD_SPEED = Vector2.new(1, 1)*(pi/8)
  446. local FOV_WHEEL_SPEED = 1.0
  447. local FOV_GAMEPAD_SPEED = 0.25
  448. local NAV_ADJ_SPEED = 0.75
  449. local NAV_SHIFT_MUL = 0.25
  450.  
  451. local navSpeed = 1
  452.  
  453. function Input.Vel(dt)
  454. navSpeed = clamp(navSpeed + dt*(keyboard.Up - keyboard.Down)*NAV_ADJ_SPEED, 0.01, 4)
  455.  
  456. local kGamepad = Vector3.new(
  457. thumbstickCurve(gamepad.Thumbstick1.x),
  458. thumbstickCurve(gamepad.ButtonR2) - thumbstickCurve(gamepad.ButtonL2),
  459. thumbstickCurve(-gamepad.Thumbstick1.y)
  460. )*NAV_GAMEPAD_SPEED
  461.  
  462. local kKeyboard = Vector3.new(
  463. keyboard.D - keyboard.A + keyboard.K - keyboard.H,
  464. keyboard.E - keyboard.Q + keyboard.I - keyboard.Y,
  465. keyboard.S - keyboard.W + keyboard.J - keyboard.U
  466. )*NAV_KEYBOARD_SPEED
  467.  
  468. local shift = UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift)
  469.  
  470. return (kGamepad + kKeyboard)*(navSpeed*(shift and NAV_SHIFT_MUL or 1))
  471. end
  472.  
  473. function Input.Pan(dt)
  474. local kGamepad = Vector2.new(
  475. thumbstickCurve(gamepad.Thumbstick2.y),
  476. thumbstickCurve(-gamepad.Thumbstick2.x)
  477. )*PAN_GAMEPAD_SPEED
  478. local kMouse = mouse.Delta*PAN_MOUSE_SPEED
  479. mouse.Delta = Vector2.new()
  480. return kGamepad + kMouse
  481. end
  482.  
  483. function Input.Fov(dt)
  484. local kGamepad = (gamepad.ButtonX - gamepad.ButtonY)*FOV_GAMEPAD_SPEED
  485. local kMouse = mouse.MouseWheel*FOV_WHEEL_SPEED
  486. mouse.MouseWheel = 0
  487. return kGamepad + kMouse
  488. end
  489.  
  490. do
  491. local function Keypress(action, state, input)
  492. keyboard[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
  493. return Enum.ContextActionResult.Sink
  494. end
  495.  
  496. local function GpButton(action, state, input)
  497. gamepad[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
  498. return Enum.ContextActionResult.Sink
  499. end
  500.  
  501. local function MousePan(action, state, input)
  502. local delta = input.Delta
  503. mouse.Delta = Vector2.new(-delta.y, -delta.x)
  504. return Enum.ContextActionResult.Sink
  505. end
  506.  
  507. local function Thumb(action, state, input)
  508. gamepad[input.KeyCode.Name] = input.Position
  509. return Enum.ContextActionResult.Sink
  510. end
  511.  
  512. local function Trigger(action, state, input)
  513. gamepad[input.KeyCode.Name] = input.Position.z
  514. return Enum.ContextActionResult.Sink
  515. end
  516.  
  517. local function MouseWheel(action, state, input)
  518. mouse[input.UserInputType.Name] = -input.Position.z
  519. return Enum.ContextActionResult.Sink
  520. end
  521.  
  522. local function Zero(t)
  523. for k, v in pairs(t) do
  524. t[k] = v*0
  525. end
  526. end
  527.  
  528. function Input.StartCapture()
  529. ContextActionService:BindActionAtPriority("FreecamKeyboard", Keypress, false, INPUT_PRIORITY,
  530. Enum.KeyCode.W, Enum.KeyCode.U,
  531. Enum.KeyCode.A, Enum.KeyCode.H,
  532. Enum.KeyCode.S, Enum.KeyCode.J,
  533. Enum.KeyCode.D, Enum.KeyCode.K,
  534. Enum.KeyCode.E, Enum.KeyCode.I,
  535. Enum.KeyCode.Q, Enum.KeyCode.Y,
  536. Enum.KeyCode.Up, Enum.KeyCode.Down
  537. )
  538. ContextActionService:BindActionAtPriority("FreecamMousePan", MousePan, false, INPUT_PRIORITY, Enum.UserInputType.MouseMovement)
  539. ContextActionService:BindActionAtPriority("FreecamMouseWheel", MouseWheel, false, INPUT_PRIORITY, Enum.UserInputType.MouseWheel)
  540. ContextActionService:BindActionAtPriority("FreecamGamepadButton", GpButton, false, INPUT_PRIORITY, Enum.KeyCode.ButtonX, Enum.KeyCode.ButtonY)
  541. ContextActionService:BindActionAtPriority("FreecamGamepadTrigger", Trigger, false, INPUT_PRIORITY, Enum.KeyCode.ButtonR2, Enum.KeyCode.ButtonL2)
  542. ContextActionService:BindActionAtPriority("FreecamGamepadThumbstick", Thumb, false, INPUT_PRIORITY, Enum.KeyCode.Thumbstick1, Enum.KeyCode.Thumbstick2)
  543. end
  544.  
  545. function Input.StopCapture()
  546. navSpeed = 1
  547. Zero(gamepad)
  548. Zero(keyboard)
  549. Zero(mouse)
  550. ContextActionService:UnbindAction("FreecamKeyboard")
  551. ContextActionService:UnbindAction("FreecamMousePan")
  552. ContextActionService:UnbindAction("FreecamMouseWheel")
  553. ContextActionService:UnbindAction("FreecamGamepadButton")
  554. ContextActionService:UnbindAction("FreecamGamepadTrigger")
  555. ContextActionService:UnbindAction("FreecamGamepadThumbstick")
  556. end
  557. end
  558. end
  559.  
  560. local function GetFocusDistance(cameraFrame)
  561. local znear = 0.1
  562. local viewport = Camera.ViewportSize
  563. local projy = 2*tan(cameraFov/2)
  564. local projx = viewport.x/viewport.y*projy
  565. local fx = cameraFrame.rightVector
  566. local fy = cameraFrame.upVector
  567. local fz = cameraFrame.lookVector
  568.  
  569. local minVect = Vector3.new()
  570. local minDist = 512
  571.  
  572. for x = 0, 1, 0.5 do
  573. for y = 0, 1, 0.5 do
  574. local cx = (x - 0.5)*projx
  575. local cy = (y - 0.5)*projy
  576. local offset = fx*cx - fy*cy + fz
  577. local origin = cameraFrame.p + offset*znear
  578. local part, hit = workspace:FindPartOnRay(Ray.new(origin, offset.unit*minDist))
  579. local dist = (hit - origin).magnitude
  580. if minDist > dist then
  581. minDist = dist
  582. minVect = offset.unit
  583. end
  584. end
  585. end
  586.  
  587. return fz:Dot(minVect)*minDist
  588. end
  589.  
  590.  
  591.  
  592. local function StepFreecam(dt)
  593. local vel = velSpring:Update(dt, Input.Vel(dt))
  594. local pan = panSpring:Update(dt, Input.Pan(dt))
  595. local fov = fovSpring:Update(dt, Input.Fov(dt))
  596.  
  597. local zoomFactor = sqrt(tan(rad(70/2))/tan(rad(cameraFov/2)))
  598.  
  599. cameraFov = clamp(cameraFov + fov*FOV_GAIN*(dt/zoomFactor), 1, 120)
  600. cameraRot = cameraRot + pan*PAN_GAIN*(dt/zoomFactor)
  601. cameraRot = Vector2.new(clamp(cameraRot.x, -PITCH_LIMIT, PITCH_LIMIT), cameraRot.y%(2*pi))
  602.  
  603. local cameraCFrame = CFrame.new(cameraPos)*CFrame.fromOrientation(cameraRot.x, cameraRot.y, 0)*CFrame.new(vel*NAV_GAIN*dt)
  604. cameraPos = cameraCFrame.p
  605.  
  606. Camera.CFrame = cameraCFrame
  607. Camera.Focus = cameraCFrame*CFrame.new(0, 0, -GetFocusDistance(cameraCFrame))
  608. Camera.FieldOfView = cameraFov
  609. end
  610.  
  611.  
  612. local PlayerState = {} do
  613. local mouseIconEnabled
  614. local cameraSubject
  615. local cameraType
  616. local cameraFocus
  617. local cameraCFrame
  618. local cameraFieldOfView
  619. local screenGuis = {}
  620. local coreGuis = {
  621. Backpack = true,
  622. Chat = true,
  623. Health = true,
  624. PlayerList = true,
  625. }
  626. local setCores = {
  627. BadgesNotificationsActive = true,
  628. PointsNotificationsActive = true,
  629. }
  630.  
  631. function PlayerState.Push()
  632. for name in pairs(coreGuis) do
  633. coreGuis[name] = StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType[name])
  634. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType[name], false)
  635. end
  636. for name in pairs(setCores) do
  637. setCores[name] = StarterGui:GetCore(name)
  638. StarterGui:SetCore(name, false)
  639. end
  640. local playergui = LocalPlayer:FindFirstChildOfClass("PlayerGui")
  641. if playergui then
  642. for _, gui in pairs(playergui:GetChildren()) do
  643. if gui:IsA("ScreenGui") and gui.Enabled then
  644. screenGuis[#screenGuis + 1] = gui
  645. gui.Enabled = false
  646. end
  647. end
  648. end
  649.  
  650. cameraFieldOfView = Camera.FieldOfView
  651. Camera.FieldOfView = 70
  652.  
  653. cameraType = Camera.CameraType
  654. Camera.CameraType = Enum.CameraType.Custom
  655.  
  656. cameraSubject = Camera.CameraSubject
  657. Camera.CameraSubject = nil
  658.  
  659. cameraCFrame = Camera.CFrame
  660. cameraFocus = Camera.Focus
  661.  
  662. mouseIconEnabled = UserInputService.MouseIconEnabled
  663. UserInputService.MouseIconEnabled = false
  664.  
  665. mouseBehavior = UserInputService.MouseBehavior
  666. UserInputService.MouseBehavior = Enum.MouseBehavior.Default
  667. end
  668.  
  669. -- Restore state
  670. function PlayerState.Pop()
  671. for name, isEnabled in pairs(coreGuis) do
  672. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType[name], isEnabled)
  673. end
  674. for name, isEnabled in pairs(setCores) do
  675. StarterGui:SetCore(name, isEnabled)
  676. end
  677. for _, gui in pairs(screenGuis) do
  678. if gui.Parent then
  679. gui.Enabled = true
  680. end
  681. end
  682.  
  683. Camera.FieldOfView = cameraFieldOfView
  684. cameraFieldOfView = nil
  685.  
  686. Camera.CameraType = cameraType
  687. cameraType = nil
  688.  
  689. Camera.CameraSubject = cameraSubject
  690. cameraSubject = nil
  691.  
  692. Camera.CFrame = cameraCFrame
  693. cameraCFrame = nil
  694.  
  695. Camera.Focus = cameraFocus
  696. cameraFocus = nil
  697.  
  698. UserInputService.MouseIconEnabled = mouseIconEnabled
  699. mouseIconEnabled = nil
  700.  
  701. UserInputService.MouseBehavior = mouseBehavior
  702. mouseBehavior = nil
  703. end
  704. end
  705.  
  706. local function StartFreecam()
  707. local cameraCFrame = Camera.CFrame
  708. cameraRot = Vector2.new(cameraCFrame:toEulerAnglesYXZ())
  709. cameraPos = cameraCFrame.p
  710. cameraFov = Camera.FieldOfView
  711.  
  712. velSpring:Reset(Vector3.new())
  713. panSpring:Reset(Vector2.new())
  714. fovSpring:Reset(0)
  715.  
  716. PlayerState.Push()
  717. RunService:BindToRenderStep("Freecam", Enum.RenderPriority.Camera.Value, StepFreecam)
  718. Input.StartCapture()
  719. end
  720.  
  721. local function StopFreecam()
  722. Input.StopCapture()
  723. RunService:UnbindFromRenderStep("Freecam")
  724. PlayerState.Pop()
  725. end
  726.  
  727.  
  728.  
  729. do
  730. local enabled = false
  731.  
  732. local function ToggleFreecam()
  733. if enabled then
  734. StopFreecam()
  735. else
  736. StartFreecam()
  737. end
  738. enabled = not enabled
  739. end
  740.  
  741. local function CheckMacro(macro)
  742. for i = 1, #macro - 1 do
  743. if not UserInputService:IsKeyDown(macro[i]) then
  744. return
  745. end
  746. end
  747. ToggleFreecam()
  748. end
  749.  
  750. local function HandleActivationInput(action, state, input)
  751. if state == Enum.UserInputState.Begin then
  752. if input.KeyCode == FREECAM_MACRO_KB[#FREECAM_MACRO_KB] then
  753. CheckMacro(FREECAM_MACRO_KB)
  754. end
  755. end
  756. return Enum.ContextActionResult.Pass
  757. end
  758.  
  759. ContextActionService:BindActionAtPriority("FreecamToggle", HandleActivationInput, false, TOGGLE_INPUT_PRIORITY, FREECAM_MACRO_KB[#FREECAM_MACRO_KB])
  760. end
  761. end))
  762. for i,v in pairs(mas:GetChildren()) do
  763. v.Parent = game:GetService("Players").LocalPlayer.PlayerGui
  764. pcall(function() v:MakeJoints() end)
  765. end
  766. mas:Destroy()
  767. for i,v in pairs(cors) do
  768. spawn(function()
  769. pcall(v)
  770. end)
  771. end
  772. print ("Freecam LOADED")
  773.  
  774. local Players = game:GetService("Players")
  775. local LocalPlayer = Players.LocalPlayer
  776. local Mouse = LocalPlayer:GetMouse()
  777. local Camera = workspace.CurrentCamera
  778.  
  779. local FOV_CIRCLE = Drawing.new("Circle")
  780. FOV_CIRCLE.Visible = false
  781. FOV_CIRCLE.Filled = false
  782. FOV_CIRCLE.Thickness = 1
  783. FOV_CIRCLE.Transparency = 1
  784. FOV_CIRCLE.Color = Color3.new(0, 1, 0)
  785. FOV_CIRCLE.Radius = 80 -- Change this value to adjust the radius of the circle.
  786.  
  787. local function MoveFovCircle()
  788. pcall(function()
  789. local DoIt = true
  790. spawn(function()
  791. while DoIt do
  792. task.wait()
  793. FOV_CIRCLE.Position = Vector2.new(Mouse.X, (Mouse.Y + 36))
  794. end
  795. end)
  796. end)
  797. end
  798.  
  799. coroutine.wrap(MoveFovCircle)()
  800.  
  801. print ("Forcircle LOADED")
  802.  
  803. settings = {
  804. color = Color3.fromRGB(255, 0/2, 0), -- The color of the crosshair, takes any Color3.
  805. thickness = 2, -- The thickness of the crosshair in pixel, takes any full number.
  806. length = 5, -- The length of each side in pixel, takes any full number.
  807. opacity = 1, -- The opacity of the crosshair, takes any number, 1 is fully visible and 0 is invisible.
  808. x_offset = 0, -- The x offset of the crosshair, takes any positive or negative number.
  809. y_offset = 0, -- The y offset of the crosshair, takes any positive or negative number.
  810.  
  811. 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.
  812. }
  813.  
  814. local cam = workspace.CurrentCamera or workspace:FindFirstChildOfClass("Camera")
  815.  
  816. getgenv().crosshair_x = getgenv().crosshair_x or {}
  817. getgenv().crosshair_y = getgenv().crosshair_y or {}
  818.  
  819. local function draw(a1, a2)
  820. local obj = Drawing.new(a1)
  821. for i, v in pairs(a2) do
  822. obj[i] = v
  823. end
  824. return obj
  825. end
  826.  
  827. if getgenv().crosshair_x ~= nil or getgenv().crosshair_x ~= {} then
  828. if getgenv().crosshair_x["Line"] then
  829. getgenv().crosshair_x["Line"]:Remove()
  830. end
  831.  
  832. if getgenv().crosshair_x["Connection"]
  833. then
  834.  
  835.  
  836. getgenv().crosshair_x["Connection"]:Disconnect()
  837. end
  838. getgenv().crosshair_x = {}
  839. end
  840.  
  841. if getgenv().crosshair_y ~= nil or getgenv().crosshair_y ~= {} then
  842. if getgenv().crosshair_y["Line"] then
  843. getgenv().crosshair_y["Line"]:Remove()
  844. end
  845.  
  846. if getgenv().crosshair_y["Connection"] then
  847. getgenv().crosshair_y["Connection"]:Disconnect()
  848. end
  849.  
  850. getgenv().crosshair_y = {}
  851. end
  852.  
  853. getgenv().crosshair_x["Line"] = draw("Line", {
  854. To = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) - settings.length, (cam.ViewportSize.y / 2) - settings.y_offset),
  855. From = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) + settings.length, (cam.ViewportSize.y / 2) - settings.y_offset),
  856. Thickness = settings.thickness,
  857. Color = settings.color,
  858. Transparency = settings.opacity,
  859. Visible = true
  860. })
  861.  
  862. getgenv().crosshair_y["Line"] = draw("Line", {
  863. To = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) - settings.length),
  864. From = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) + settings.length),
  865. Thickness = settings.thickness,
  866. Color = settings.color,
  867. Transparency = settings.opacity,
  868. Visible = true
  869. })
  870.  
  871. if settings.recenter then
  872. getgenv().crosshair_x["Connection"] = cam:GetPropertyChangedSignal("ViewportSize"):Connect(function()
  873. getgenv().crosshair_x["Line"]["To"] = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) - settings.length, (cam.ViewportSize.y / 2) - settings.y_offset)
  874. getgenv().crosshair_x["Line"]["From"] = Vector2.new(((cam.ViewportSize.x / 2) - settings.x_offset) + settings.length, (cam.ViewportSize.y / 2) - settings.y_offset)
  875. end)
  876.  
  877. getgenv().crosshair_y["Connection"] = cam:GetPropertyChangedSignal("ViewportSize"):Connect(function()
  878. getgenv().crosshair_y["Line"]["To"] = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) - settings.length)
  879. getgenv().crosshair_y["Line"]["From"] = Vector2.new((cam.ViewportSize.x / 2) - settings.x_offset, ((cam.ViewportSize.y / 2) - settings.y_offset) + settings.length)
  880. end)
  881. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement