local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local remote = RS:FindFirstChild("FlingService") if not remote then remote = Instance.new("RemoteEvent") remote.Name = "FlingService" remote.Parent = RS end -- Config local RANGE = 8 local FLING_SPEED = 80 local FLING_UP = 40 local SHIELD_DURATION = 2 local COOLDOWN = 1.5 local CHECK_INTERVAL = 0.15 local function getHRP(char) return char and (char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("LowerTorso") or char:FindFirstChild("Torso")) end local cooldowns = {} local tracked = {} local activeModes = {} -- player.UserId = true/false local function canFling(sourceId, targetId) cooldowns[sourceId] = cooldowns[sourceId] or {} local last = cooldowns[sourceId][targetId] if last and tick() - last < COOLDOWN then return false end cooldowns[sourceId][targetId] = tick() return true end local function giveShieldTo(player, duration) if not player or not player.Character then return end local char = player.Character char:SetAttribute("ShieldActive", true) remote:FireClient(player, "ShieldOn", duration) delay(duration, function() if char then char:SetAttribute("ShieldActive", false) remote:FireClient(player, "ShieldOff") end end) end local function flingTarget(sourcePlayer, targetPlayer) if not sourcePlayer or not targetPlayer then return end if not sourcePlayer.Character or not targetPlayer.Character then return end local sourceHRP = getHRP(sourcePlayer.Character) local targetHRP = getHRP(targetPlayer.Character) if not sourceHRP or not targetHRP then return end if not canFling(sourcePlayer.UserId, targetPlayer.UserId) then return end local dir = (targetHRP.Position - sourceHRP.Position).Unit if dir ~= dir then dir = Vector3.new(0,1,0) end local flingVel = dir * FLING_SPEED + Vector3.new(0, FLING_UP, 0) targetHRP.AssemblyLinearVelocity = flingVel delay(0.25, function() if targetHRP and targetHRP.Parent then targetHRP.AssemblyLinearVelocity = targetHRP.AssemblyLinearVelocity * 0.25 end end) end local function onCharacterAdded(player, char) tracked[player.UserId] = {player = player, char = char} char:SetAttribute("ShieldActive", false) end local function onPlayerAdded(player) player.CharacterAdded:Connect(function(char) onCharacterAdded(player, char) end) if player.Character then onCharacterAdded(player, player.Character) end activeModes[player.UserId] = false -- default pasif end Players.PlayerAdded:Connect(onPlayerAdded) for _,p in pairs(Players:GetPlayers()) do onPlayerAdded(p) end -- Event from client: toggle fling mode remote.OnServerEvent:Connect(function(player, action) if action == "ToggleFling" then local current = activeModes[player.UserId] activeModes[player.UserId] = not current -- opsiyonel: player'a bildirim atabiliriz remote:FireClient(player, "FlingModeChanged", activeModes[player.UserId]) end end) local accumulator = 0 RunService.Heartbeat:Connect(function(dt) accumulator = accumulator + dt if accumulator < CHECK_INTERVAL then return end accumulator = 0 for userId, data in pairs(tracked) do local player = data.player local char = player and player.Character if not char or not player.Parent then tracked[userId] = nil activeModes[userId] = nil continue end if not activeModes[userId] then continue end -- aktif değilse atla local hrp = getHRP(char) if not hrp then continue end for _, other in pairs(Players:GetPlayers()) do if other ~= player and other.Character and other.Character:FindFirstChild("HumanoidRootPart") then local otherHRP = other.Character.HumanoidRootPart local dist = (otherHRP.Position - hrp.Position).Magnitude if dist <= RANGE then if player.Team and other.Team and player.Team == other.Team then -- takımdaşsa atla else giveShieldTo(player, SHIELD_DURATION) flingTarget(player, other) end end end end end end) Players.PlayerRemoving:Connect(function(p) tracked[p.UserId] = nil activeModes[p.UserId] = nil end) local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local remote = RS:WaitForChild("FlingService") local SPEED_BOOST = 5 local shieldPart = nil local originalWalkSpeed = humanoid.WalkSpeed local shieldActive = false local flingActive = false local function createShieldVisual() if shieldPart and shieldPart.Parent then return end shieldPart = Instance.new("Part") shieldPart.Name = "ShieldVisual" shieldPart.Size = Vector3.new(4,4,4) shieldPart.Transparency = 0.6 shieldPart.CanCollide = false shieldPart.Anchored = false shieldPart.Parent = workspace local mesh = Instance.new("SpecialMesh", shieldPart) mesh.MeshType = Enum.MeshType.Sphere mesh.Scale = Vector3.new(3,3,3) local weld = Instance.new("WeldConstraint") weld.Part0 = shieldPart weld.Part1 = character:WaitForChild("HumanoidRootPart") weld.Parent = shieldPart end local function removeShieldVisual() if shieldPart then shieldPart:Destroy() shieldPart = nil end end -- Buton UI local PlayerGui = player:WaitForChild("PlayerGui") local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "FlingGui" ScreenGui.ResetOnSpawn = false ScreenGui.Parent = PlayerGui local Button = Instance.new("TextButton") Button.Size = UDim2.new(0, 100, 0, 40) Button.Position = UDim2.new(1, -110, 0, 10) -- ekran sağ üst köşe (hafif içeride) Button.BackgroundColor3 = Color3.new(1, 0, 0) -- kırmızı (pasif) Button.Text = "Fling OFF" Button.TextColor3 = Color3.new(1,1,1) Button.Font = Enum.Font.SourceSansBold Button.TextScaled = true Button.Parent = ScreenGui Button.MouseButton1Click:Connect(function() flingActive = not flingActive if flingActive then Button.BackgroundColor3 = Color3.new(0, 0, 1) -- mavi (aktif) Button.Text = "Fling ON" else Button.BackgroundColor3 = Color3.new(1, 0, 0) -- kırmızı (pasif) Button.Text = "Fling OFF" end remote:FireServer("ToggleFling") end) remote.OnClientEvent:Connect(function(action, param) if action == "ShieldOn" then if shieldActive then return end shieldActive = true originalWalkSpeed = humanoid.WalkSpeed humanoid.WalkSpeed = originalWalkSpeed + SPEED_BOOST createShieldVisual() elseif action == "ShieldOff" then shieldActive = false if humanoid and humanoid.Parent then humanoid.WalkSpeed = originalWalkSpeed or 16 end removeShieldVisual() elseif action == "FlingModeChanged" then -- Server’dan da aktiflik bilgisi gelir (ör. sync için) flingActive = param if flingActive then Button.BackgroundColor3 = Color3.new(0, 0, 1) Button.Text = "Fling ON" else Button.BackgroundColor3 = Color3.new(1, 0, 0) Button.Text = "Fling OFF" end end end) player.CharacterAdded:Connect(function(char) character = char humanoid = character:WaitForChild("Humanoid") end)