Pastebin
Paste #49705: No description
< previous paste - next paste>
Pasted by Anonymous Coward
-- Zo Samurai 0 Delay Script (No GUI)
-- This script attempts to remove the delay between attacks.
-- Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Player
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
-- The remote event for attacking. This name might change with game updates.
-- Common names are "Slash", "Attack", "Combat", "Melee".
-- We will try to find it dynamically to be more robust.
local attackRemote = ReplicatedStorage:FindFirstChild("Slash") or ReplicatedStorage:FindFirstChild("Attack") or ReplicatedStorage:FindFirstChild("Combat")
if not attackRemote then
player:Kick("0 Delay Script: Could not find the attack remote. The game may have updated.")
return
end
-- Function to handle attacking
local function attack()
-- Fire the server with the attack remote. This is what sends the action to the server.
-- Some games might require arguments, but for a basic attack, it's often fire-and-forget.
attackRemote:FireServer()
end
-- Connect to the input to know when the player wants to attack
UserInputService.InputBegan:Connect(function(input, gameProcessed)
-- Check if the input was the left mouse button and it wasn't processed by the GUI
if input.UserInputType == Enum.UserInputType.MouseButton1 and not gameProcessed then
-- Call the attack function
attack()
end
end)
New Paste
Go to most recent paste.