Stworzyłem prosty skrypt lua do roblox ale niestety blok nie zadaje obrażeń innym graczą może ktoś umie to naprawić
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local targetPlayer
local followBlock
local isActive = false
-- Tworzenie GUI
local screenGui = Instance.new("ScreenGui", Players.LocalPlayer:WaitForChild("PlayerGui"))
local targetTextBox = Instance.new("TextBox", screenGui)
targetTextBox.Size = UDim2.new(0.3, 0, 0, 50)
targetTextBox.Position = UDim2.new(0.5, -150, 0, 10)
targetTextBox.PlaceholderText = "Wpisz nazwę gracza"
targetTextBox.TextColor3 = Color3.new(1, 1, 1)
targetTextBox.BackgroundColor3 = Color3.new(0, 0, 0)
local activateButton = Instance.new("TextButton", screenGui)
activateButton.Size = UDim2.new(0.3, 0, 0, 50)
activateButton.Position = UDim2.new(0.5, -150, 0, 70)
activateButton.Text = "Aktywuj"
activateButton.BackgroundColor3 = Color3.new(0, 1, 0)
local deactivateButton = Instance.new("TextButton", screenGui)
deactivateButton.Size = UDim2.new(0.3, 0, 0, 50)
deactivateButton.Position = UDim2.new(0.5, -150, 0, 130)
deactivateButton.Text = "Dezaktywuj"
deactivateButton.BackgroundColor3 = Color3.new(1, 0, 0)
-- Funkcja do aktywacji
local function activate()
if targetPlayer then
isActive = true
followBlock = Instance.new("Part")
followBlock.Size = Vector3.new(2, 2, 2)
followBlock.Color = Color3.new(1, 0, 0)
followBlock.Anchored = true
followBlock.Parent = workspace
-- Podążanie za graczem
RunService.RenderStepped:Connect(function()
if isActive and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
local targetPosition = targetPlayer.Character.HumanoidRootPart.Position
followBlock.Position = targetPosition + Vector3.new(0, 5, 0) -- Ustawienie nad graczem
-- Zadaj obrażenia
if (followBlock.Position - targetPosition).Magnitude < 3 then
local humanoid = targetPlayer.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid:TakeDamage(10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) -- Obrażenia
end
end
end
end)
end
end
-- Funkcja do dezaktywacji
local function deactivate()
isActive = false
if followBlock then
followBlock:Destroy()
followBlock = nil
end
end
-- Aktywacja po kliknięciu przycisku
activateButton.MouseButton1Click:Connect(function()
local playerName = targetTextBox.Text
targetPlayer = Players:FindFirstChild(playerName)
if targetPlayer then
activate()
else
print("Gracz o nazwie " .. playerName .. " nie został znaleziony.")
end
end)
-- Dezaktyacja po kliknięciu przycisku
deactivateButton.MouseButton1Click:Connect(function()
deactivate()
end)