RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a advanced swordscript for a sword tool"
-- local script local sword = script.Parent local swordDamage = 10 local swordRange = 5 local function onActivated() local character = sword.Parent.Parent local humanoid = character:FindFirstChild("Humanoid") if humanoid then local target = humanoid:GetClosestHumanoid(swordRange) if target then target.Health = target.Health - swordDamage end end end sword.Activated:Connect(onActivated)