Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I script a sword without handle?

2 answers

Are there any parts in the sword? I would make a invisible part surrounding the entire sword and have a Touched event on the part.

1 comment

0

I did that but it didn't work since my swords aren't modeled, they're union into 1 part

Well, if you have parts in the sword that touches someone when you hit them then you can use the basic:

for _,v in pairs(sword:GetChildren()) do
v.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.Character.Humanoid:TakeDamage(the amount of damage you want)
end
end)
end

I hope this answered your question!

1 comment

0

Also, if you're using a union part, you can just make a variable stating where it is and used the same .Touched function as I used except changing "v" with the variable name that you have made for the Union

This discussion is preserved as it was. New answers, comments, and votes are closed.