Sword Smith | Script Swords in Just Minutes! [FREE]

Not really sure about creating a blaster module, as I’m not really the best with making guns or any type of projectile weapons. However if you’re looking for a good module that can create guns with ease, I suggest looking at some of the resources below:

However the deflection may be something I’m capable of doing, with the blocking system. I’m currently working on an update to celebrate 1k views on this post, I’ll consider adding a blocking/deflecting system.

3 Likes

Update

I figured that since I quite regularly update Sword Smith, it was about time to make something that automatically updates it. And surprisingly this didn’t take that long. This’ll be a huge help especially since I plan on updating a lot basically all week to celebrate 1k views on this post. The auto-migrator that I’ve just added will make it so even when there’s a new update, you don’t have to migrate to the next update manually. The module now migrates on it’s own.

For those of you who may not find this to be clear. Sword Smith is a free model, when you place it in your game it cannot be changed by anybody but you and your game developing partners. This means that whenever I release a new update, you can’t use it until you’ve migrated to the next update.

Migrating is pretty simple, all you have to do is delete the module from your game and add it back in using the toolbox. This however can become a pain since I quite regularly update the module. This will be the last migration that you will ever have to do because of this small snippet of code I added this afternoon (depending on your time zone):

if script.Parent:GetFullName() ~= "Model" then
		print([[
			SwordSmith is now loading!
		]]);
		local currentVersion = 
			{
				high = sword._VERSION:match'%d+',
				low =({ sword._VERSION:gsub('%d+%.','') })[1],
			};
		
		local newAssetid = 6946292010;
		local alternateModel = require(InsertService:LoadAsset(newAssetid):WaitForChild("SwordSmith"));
		alternateModel._DOINIT = false;
		
		local alternateVersion = 
			{
				high = alternateModel._VERSION:match'%d+',
				low = ({ alternateModel._VERSION:gsub('%d+%.','') })[1],
			};
		
		local migrateTo =
			{
				tonumber(currentVersion.high) < tonumber(alternateVersion.high),
				tonumber(currentVersion.low) < tonumber(alternateVersion.low),
			}; for _, bool in pairs(migrateTo) do
			if bool then
				return alternateModel;
			end;
		end;
	end

To get this migration update you don’t need to do anything, but migrate one last time. No other action is required. Enjoy.

I would like to note that I will soon be creating a lot of updates to Sword Smith to boost performance, customizability, and more to celebrate 1k views on this post (and maybe 100 sales?) Make sure to stay tuned all week, because there will be atleast one update a day, some of these include:


I’d like to give a big thanks to @foundanerror for helping me with this new auto-migration update!

6 Likes

Hi
I’m trying this out but I can’t get an animation to play. Here’s my code:

local ServerStorage = game:GetService("ServerStorage")
local SwordSmith = require(ServerStorage:WaitForChild("SwordSmith"))

local tool = script.Parent
local debounce = false
local data = {swingAnims={6947086383}}

local sword = SwordSmith.new(tool, data)

tool.Activated:Connect(function()
	if debounce then
		return
	end

	debounce = true
	sword:Swing()
end);

sword:OnSwingEnded(function()
	--You can of course add extra delay if you have a short swing animation
	debounce = false
end)

There are no errors, the animation just doesn’t play. I used the ID from your post.

1 Like

Sadly you can only use animations you make yourself on roblox. If you’re having trouble making an animation I suggest you watch this video for help.

2 Likes

As I am kind of a Roblox bladesmith, I will certainly give this a try!

2 Likes

I love this module! I have one question, How can I determine how much damage I want the sword to do?

1 Like

When you create the data table for your sword you can use the currentDamage property, which by default is about 25 I believe.

local data = {
	...,--Other necessary properties
	currentDamage = 45,
};
2 Likes

Wow it’s my own module, can’t believe I forgot this. When you call the :Swing method there’s a damage and ignore list property. Probably more efficient to do it this way.

local Damage = 45;

sword:Swing(Damage);
2 Likes

Update v1.1: Better Hitboxes

(Update 1/7 for 1k views celebration :partying_face:)

Something that’s been bothering me ever since the release of Sword Smith was the fact hit boxes were only adjoined to the handle. This could potentially create inaccuracies in the hitboxes for swords containing multiple parts. If the handle is only a fraction of the size of a whole sword model, then only a fraction of the sword can damage people.

This new update creates a “fake handle” in swords containing multiple parts and creates nodes inside of this part to ensure accuracy. As I had mentioned in my last update, you no longer need to update Sword Smith, it now updates itself automatically. To enable this better hitboxes feature no action is required, more accurate hitboxes will be created automatically once the sword class has been created.

5 Likes

I have found a bug when you unequip the sword the holding animation still plays.

2 Likes

If I had to be honest I rushed the holding animations feature a bit, thanks for the report. I’ll work for some time to get them up to speed with the swinging animations.

2 Likes

I think the issue is fixed, let me know if you’re still having problems. I’d be happy to help!

2 Likes

Update v1.12: Critical Hits

(Update 2/7 for 1k views celebration :partying_face:)

I’ll be updating Sword Smith all week long so stay tuned for more updates. Today I decided to get the critical hits update out of the way. It’s simple but it makes for a good combat system. I’ve been playing around with stylizing dev forum posts. Let me know if you like it because I might consider re-writing the main post.

Critical Hits

A critical hit is when you swing your sword multiple times and then one of those swings causes more damage. Which is why it’s called a critical hit, it’s a hit that packs more of a punch. Through use of the data table, it’s possible to create critical hits.

local data = {
	criticalHits = 45, --How much damage is dealt to the target on a critical hit
	criticalInterval = 3, --How many swings it takes until a critical hit happens
}

All information above can be found in the Basic Usage category.

2 Likes

You could also add a optional critical hit swing animation.

1 Like

I think it’s great! The idea is a great work!

1 Like

Back when I had first created the sword actions update, I had made people set up the client-sided works of the system themselves. It was pretty inefficient so I decided to make the module do this automatically. Now all you need to do to set up your actions is:

sword:BindAction("F", 2, function(player)
	print(player.Name .. " has pressed the \"F\" key!")
end)

Sorry for not updating, been on a long vacation

1 Like

It came to my attention that the Sword Smith module completely broke yesterday because of he update. As far as I know this has been fixed, but if you’re still experiencing issues please let me know!

1 Like

What are all the data settings we could add?

local data = {}

I am getting 2 errors for the module:

“Requested module experienced an error while loading” which is happening on Line 63

local alternateModel = require(InsertService:LoadAsset(newAssetid):WaitForChild("SwordSmith"));

And “HTTP 403 (Forbidden)” on Line 83

smithClient = InsertService:LoadAsset(7041108563):GetChildren()[1] do

This also gives the error “Requested module experienced an error while loading” in my sword script.
Is this a studio problem or maybe I got an older version of the model? How do I solve these?

1 Like

For further information you can read the Basic Usage tab.

2 Likes