How To Make A Working Sword (Roblox Scripting)

Опубликовано: 27 Май 2026
на канале: ReLic
14,820
132

Don't Forget To Like And Subscribe!

Facebook -   / block-studio-143033679529130  
--------------------------------
Twitter -   / blockstudio2  
-------------------------------------------------------------------
Song -   / 2scoops-donuts-radio-edit  
----------------------------
Local Script:
repeat wait() until game.Players.LocalPlayer.Character

script.Parent.Parent.Equipped:Connect(function()
local Anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
script.Parent.Parent.Activated:Connect(function()
Anim:Play()
script.Parent.Parent.Damage.Value = true
wait(1)
Anim:Stop()
script.Parent.Parent.Damage.Value = false
end)
end)
-----------------------------------------------------------------------------------
Script:
script.Parent.Parent.Equipped:Connect(function()
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= script.Parent.Parent.Parent.Name then
if script.Parent.Parent.Damage.Value == true then
hit.Parent.Humanoid:TakeDamage(10)
end
end
end
end)
end)