1. local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  2.  
  3. local Players = game:GetService("Players")
  4. local RunService = game:GetService("RunService")
  5. local UIS = game:GetService("UserInputService")
  6. local Workspace = game:GetService("Workspace")
  7.  
  8. local player = Players.LocalPlayer
  9. local Camera = Workspace.CurrentCamera
  10.  
  11. --------------------------------------------------
  12. -- SETTINGS
  13. --------------------------------------------------
  14. local espEnabled = false
  15. local aimEnabled = false
  16. local autoShootEnabled = false
  17. local rainbowESP = false
  18. local clickAim = false
  19. local triggerBot = false
  20.  
  21. local espColor = Color3.fromRGB(255, 0, 0)
  22. local rainbowSpeed = 0.02
  23.  
  24. local smoothness = 0.15
  25. local maxDistance = 150
  26. local aimPart = "Head"
  27. local shootDelay = 0.1
  28. local triggerBotDelay = 0.05
  29.  
  30. local espObjects = {}
  31. local lastShotTime = 0
  32. local lastTriggerTime = 0
  33.  
  34. --------------------------------------------------
  35. -- UI WINDOW
  36. --------------------------------------------------
  37. local Window = Rayfield:CreateWindow({
  38. Name = "Cool Studios",
  39. Icon = 11767039004,
  40. LoadingTitle = "Cool Studios",
  41. LoadingSubtitle = "System Loading...",
  42. Theme = "Amber",
  43. ToggleUIKeybind = "K",
  44. })
  45.  
  46. local ESPTab = Window:CreateTab("ESP", 11767039004)
  47. local AimTab = Window:CreateTab("Aim Assist", 11767039004)
  48.  
  49. --------------------------------------------------
  50. -- RAINBOW
  51. --------------------------------------------------
  52. local function getRainbowColor()
  53. return Color3.fromHSV(tick() * rainbowSpeed % 1, 1, 1)
  54. end
  55.  
  56. --------------------------------------------------
  57. -- VISIBILITY CHECK (🔥 WALL CHECK)
  58. --------------------------------------------------
  59. local function isVisible(targetPart)
  60. if not targetPart or not player.Character then return false
  61.  
  62. local origin = Camera.CFrame.Position
  63. local direction = (targetPart.Position - origin).Unit * maxDistance
  64.  
  65. local params = RaycastParams.new()
  66. params.FilterType = Enum.RaycastFilterType.Blacklist
  67. params.FilterDescendantsInstances = {player.Character}
  68. params.IgnoreWater = true
  69.  
  70. local result = Workspace:Raycast(origin, direction, params)
  71.  
  72. if result and result.Instance then
  73. -- Check if the hit part belongs to the target player
  74. local hitPlayer = Players:GetPlayerFromCharacter(result.Instance.Parent)
  75. if hitPlayer and hitPlayer == Players:GetPlayerFromCharacter(targetPart.Parent) then
  76. return true
  77. end
  78. return false
  79. end
  80.  
  81. return true
  82. end
  83.  
  84. --------------------------------------------------
  85. -- ESP UI
  86. --------------------------------------------------
  87. ESPTab:CreateToggle({
  88. Name = "Enable ESP",
  89. Callback = function(Value)
  90. espEnabled = Value
  91.  
  92. if not Value then
  93. for _, obj in pairs(espObjects) do
  94. if obj then obj:Destroy() end
  95. end
  96. espObjects = {}
  97. end
  98. end,
  99. })
  100.  
  101. ESPTab:CreateToggle({
  102. Name = "Rainbow ESP",
  103. Callback = function(Value)
  104. rainbowESP = Value
  105. end,
  106. })
  107.  
  108. ESPTab:CreateColorPicker({
  109. Name = "ESP Color",
  110. Color = espColor,
  111. Callback = function(Value)
  112. espColor = Value
  113. end,
  114. })
  115.  
  116. --------------------------------------------------
  117. -- AIM UI
  118. --------------------------------------------------
  119. AimTab:CreateToggle({
  120. Name = "Enable Aim Assist",
  121. Callback = function(Value)
  122. aimEnabled = Value
  123. end,
  124. })
  125.  
  126. AimTab:CreateToggle({
  127. Name = "Only While Clicking",
  128. Callback = function(Value)
  129. clickAim = Value
  130. end,
  131. })
  132.  
  133. AimTab:CreateToggle({
  134. Name = "Auto Shoot",
  135. Callback = function(Value)
  136. autoShootEnabled = Value
  137. end,
  138. })
  139.  
  140. AimTab:CreateToggle({
  141. Name = "Trigger Bot",
  142. Callback = function(Value)
  143. triggerBot = Value
  144. end,
  145. })
  146.  
  147. AimTab:CreateSlider({
  148. Name = "Smoothness",
  149. Range = {0.05, 1},
  150. Increment = 0.05,
  151. CurrentValue = smooth1ness,
  152. Callback = function(Value)
  153. smoothness = Value
  154. end,
  155. })
  156.  
  157. AimTab:CreateSlider({
  158. Name = "Max Distance",
  159. Range = {50, 300},
  160. Increment = 10,
  161. CurrentValue = maxDistance,
  162. Callback = function(Value)
  163. maxDistance = Value
  164. end,
  165. })
  166.  
  167. AimTab:CreateSlider({
  168. Name = "Shoot Delay",
  169. Range = {0.05, 0.5},
  170. Increment = 0.05,
  171. CurrentValue = shootDelay,
  172. Callback = function(Value)
  173. shootDelay = Value
  174. end,
  175. })
  176.  
  177. AimTab:CreateSlider({
  178. Name = "TriggerBot Delay",
  179. Range = {0.01, 0.2},
  180. Increment = 0.01,
  181. CurrentValue = triggerBotDelay,
  182. Callback = function(Value)
  183. triggerBotDelay = Value
  184. end,
  185. })
  186.  
  187. AimTab:CreateDropdown({
  188. Name = "Aim Part",
  189. Options = {"Head", "Torso", "HumanoidRootPart", "UpperTorso", "LowerTorso"},
  190. CurrentOption = aimPart,
  191. Callback = function(Value)
  192. aimPart = Value
  193. end,
  194. })
  195.  
  196. --------------------------------------------------
  197. -- ESP SYSTEM
  198. --------------------------------------------------
  199. local function applyESP(plr)
  200. if plr == player then return end
  201. if not plr.Character then return end
  202.  
  203. if espObjects[plr] then
  204. espObjects[plr]:Destroy()
  205. espObjects[plr] = nil
  206. end
  207.  
  208. local h = Instance.new("Highlight")
  209.  
  210. if rainbowESP then
  211. local c = getRainbowColor()
  212. h.FillColor = c
  213. h.OutlineColor = c
  214. else
  215. h.FillColor = espColor
  216. h.OutlineColor = espColor
  217. end
  218.  
  219. h.FillTransparency = 0.5
  220. h.OutlineTransparency = 0
  221. h.Adornee = plr.Character
  222. h.Parent = plr.Character
  223.  
  224. espObjects[plr] = h
  225. end
  226.  
  227. --------------------------------------------------
  228. -- AIM SYSTEM (🔥 WITH WALL CHECK)
  229. --------------------------------------------------
  230. local function getClosestTarget()
  231. if not player.Character then return nil, nil end
  232.  
  233. local root = player.Character:FindFirstChild("HumanoidRootPart")
  234. if not root then return nil, nil end
  235.  
  236. local closestPlayer = nil
  237. local closestPart = nil
  238. local shortest = math.huge
  239.  
  240. for _, p in ipairs(Players:GetPlayers()) do
  241. if p ~= player and p.Character then
  242. local targetRoot = p.Character:FindFirstChild("HumanoidRootPart")
  243. local targetAimPart = p.Character:FindFirstChild(aimPart)
  244.  
  245. if targetRoot and targetAimPart then
  246. local dist = (root.Position - targetRoot.Position).Magnitude
  247.  
  248. -- DISTANCE + WALL CHECK
  249. if dist <= maxDistance and isVisible(targetAimPart) then
  250. if dist < shortest then
  251. shortest = dist
  252. closestPlayer = p
  253. closestPart = targetAimPart
  254. end
  255. end
  256. end
  257. end
  258. end
  259.  
  260. return closestPlayer, closestPart
  261. end
  262.  
  263. --------------------------------------------------
  264. -- AUTO SHOOT SYSTEM
  265. --------------------------------------------------
  266. local function autoShoot(targetPlayer, targetPart)
  267. if not autoShootEnabled or not targetPlayer or not targetPart then return end
  268.  
  269. local currentTime = tick()
  270. if currentTime - lastShotTime < shootDelay then return end
  271.  
  272. -- Mouse click simulation for shooting
  273. mouse1press()
  274. task.wait(0.05)
  275. mouse1release()
  276.  
  277. lastShotTime = currentTime
  278.  
  279. -- Try different attack methods for Rivals
  280. local character = player.Character
  281. if character then
  282. -- Try to find a tool/weapon
  283. local Tool = character:FindFirstChildOfClass("Tool")
  284. if Tool then
  285. -- RemoteEvent-based weapons
  286. local remoteEvent = Tool:FindFirstChild("RemoteEvent") or Tool:FindFirstChild("Fire") or Tool:FindFirstChild("Attack")
  287. if remoteEvent then
  288. remoteEvent:FireServer("Fire", targetPart.Position)
  289. return
  290. end
  291.  
  292. -- RemoteFunction-based weapons
  293. local remoteFunction = Tool:FindFirstChild("RemoteFunction") or Tool:FindFirstChild("FireFunction")
  294. if remoteFunction then
  295. remoteFunction:InvokeServer("Fire", targetPart.Position)
  296. return
  297. end
  298.  
  299. -- Standard Attack (Tool Activate)
  300. Tool:Activate()
  301. end
  302.  
  303. -- Direct damage fallback (if no tool found)
  304. if targetPlayer.Character and targetPlayer.Character:FindFirstChild("Humanoid") then
  305. local humanoid = targetPlayer.Character.Humanoid
  306. if humanoid.Health > 0 then
  307. humanoid:TakeDamage(35)
  308. end
  309. end
  310. end
  311. end
  312.  
  313. --------------------------------------------------
  314. -- TRIGGER BOT SYSTEM (FIXED)
  315. --------------------------------------------------
  316. local function triggerBotCheck()
  317. if not triggerBot then return end
  318.  
  319. local currentTime = tick()
  320. if currentTime - lastTriggerTime < triggerBotDelay then return end
  321.  
  322. -- More accurate raycast for TriggerBot
  323. local rayOrigin = Camera.CFrame.Position
  324. local rayDirection = Camera.CFrame.LookVector * maxDistance
  325.  
  326. local raycastParams = RaycastParams.new()
  327. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  328.  
  329. if player.Character then
  330. raycastParams.FilterDescendantsInstances = {player.Character}
  331. else
  332. raycastParams.FilterDescendantsInstances = {}
  333. end
  334.  
  335. raycastParams.IgnoreWater = true
  336.  
  337. local rayResult = Workspace:Raycast(rayOrigin, rayDirection, raycastParams)
  338.  
  339. if rayResult and rayResult.Instance then
  340. local hitPart = rayResult.Instance
  341. local hitModel = hitPart.Parent
  342.  
  343. -- Check if we hit a player character
  344. for _, p in ipairs(Players:GetPlayers()) do
  345. if p ~= player and p.Character and hitModel == p.Character or hitModel:IsDescendantOf(p.Character) then
  346. -- Auto-Shoot when aiming at enemy
  347. mouse1press()
  348. task.wait(0.05)
  349. mouse1release()
  350. lastTriggerTime = currentTime
  351. lastShotTime = currentTime
  352.  
  353. -- Attack methods
  354. if player.Character then
  355. local Tool = player.Character:FindFirstChildOfClass("Tool")
  356. if Tool then
  357. Tool:Activate()
  358. end
  359. end
  360.  
  361. return true -- Found target, stop checking
  362. end
  363. end
  364. end
  365.  
  366. return false -- No target found
  367. end
  368.  
  369. --------------------------------------------------
  370. -- AIM LOOP (OPTIMIZED)
  371. --------------------------------------------------
  372. RunService.RenderStepped:Connect(function()
  373. -- TriggerBot Check (independent from aimEnabled)
  374. triggerBotCheck()
  375.  
  376. if not aimEnabled then return end
  377.  
  378. -- CLICK CHECK (only for Aim Assist, not for TriggerBot)
  379. if clickAim and not UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
  380. return
  381. end
  382.  
  383. local targetPlayer, targetPart = getClosestTarget()
  384.  
  385. if not targetPart then return end
  386.  
  387. -- Smooth aiming with lerp
  388. local camPos = Camera.CFrame.Position
  389.  
  390. -- Calculate target position with slight offset for headshots
  391. local targetPos = targetPart.Position
  392. if aimPart == "Head" then
  393. targetPos = targetPos + Vector3.new(0, 0.5, 0) -- Small offset for better head aiming
  394. end
  395.  
  396. local goal = CFrame.new(camPos, targetPos)
  397.  
  398. Camera.CFrame = Camera.CFrame:Lerp(goal, smoothness)
  399.  
  400. -- Auto-Shoot after aiming (only if not already shooting from TriggerBot)
  401. if autoShootEnabled and tick() - lastShotTime >= shootDelay then
  402. autoShoot(targetPlayer, targetPart)
  403. end
  404. end)
  405.  
  406. --------------------------------------------------
  407. -- ESP LOOP (OPTIMIZED)
  408. --------------------------------------------------
  409. task.spawn(function()
  410. while true do
  411. task.wait(0.2) -- Reduced frequency for better performance
  412.  
  413. if espEnabled then
  414. for _, plr in ipairs(Players:GetPlayers()) do
  415. if plr ~= player then
  416. if plr.Character and plr.Character:FindFirstChild("Humanoid") then
  417. applyESP(plr)
  418. else
  419. -- Remove ESP if player has no character
  420. if espObjects[plr] then
  421. espObjects[plr]:Destroy()
  422. espObjects[plr] = nil
  423. end
  424. end
  425. end
  426. end
  427. else
  428. -- Clear all ESP when disabled
  429. for plr, obj in pairs(espObjects) do
  430. if obj then
  431. obj:Destroy()
  432. espObjects[plr] = nil
  433. end
  434. end
  435. end
  436.  
  437. -- Update rainbow ESP color if enabled
  438. if rainbowESP and espEnabled then
  439. for plr, obj in pairs(espObjects) do
  440. if obj and plr.Character then
  441. local c = getRainbowColor()
  442. obj.FillColor = c
  443. obj.OutlineColor = c
  444. end
  445. end
  446. end
  447. end
  448. end)
  449.  
  450. print("Rivals Combat Script mit Rayfield UI geladen!")
  451. print("Stabiler TriggerBot, Auto-Shoot, Aim Assist und ESP aktiviert")
  452. print("TriggerBot Delay: " .. triggerBotDelay .. " Sekunden")