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

Probably try turning on Http Requests.

Game Settings > Security > Http Requests

2 Likes

Actually is looks like there really was a problem with the module, should be fixed now, let me know if you’re still having trouble.

2 Likes

Yeah. Most problems are fixed with. Although, I can’t seem to use the BindEvent function because:

" SmithClient is not a valid member of PlayerGui “Players.DuckyTheClown1st.PlayerGui” "

It doesnt say which line it is but:

	smithClient = InsertService:LoadAsset(7041108563):GetChildren()[1] do
		--// Connect To Client
		smithClient.Parent = script;
		Players.PlayerAdded:Connect(function(player)
			local newClient = smithClient:Clone();
			newClient.Parent = player.PlayerGui;
			newClient.Disabled = false;

My last error included the Smith Client not being able to load. Is this the same problem? I have HTTP requests on.

1 Like

Which version are you currently working in?

2 Likes

It says version “1.14”

local sword = {
	_VERSION = "1.14",
1 Like

Sword Smith automatically transfers to it’s current version (1.18), so I’m not sure why it’s updating to 1.17 in your case. I just updated the module again, try using the BindAction function again and tell me if the problem persists. If there’s an error please let me know what it says.

2 Likes

The error I had is gone. I’m further testing now. Thanks

2 Likes

I’m having trouble understand the way Special Attacks work. Due to a recent update, we wont have to manually create an event (called Action). Its not errors but I dont get the api this time around. I tried firing the event manually but I couldnt quite get it.

  09:42:29.244   ▼  {
                    [1] =  ▼  {
                       ["Callback"] = "function",
                       ["Debounce"] =  ▶ {...},
                       ["Key"] = F

It’s a little bit of a complicated system, but I’ll try to explain it the best I can. Every time a player joins the game they are assigned a local script which takes in all the inputs and only fires the event if an action has been assigned to that key.

It then fires the remote event which brings things to the server.

It first checks if they’re supposed to be using the attack at that second, all thanks to the Debounce table, which I assume you have already discovered. It has two indexes, the first index labels the last time the action was used, and the second index labels how much time there can be in between each action.

So in short, this can’t be done manually, the key must be logged using the BindAction function beforehand for the action to be completed.

However if you’re looking to fire it manually once a key has already been bound, you can do something like this:

--Client
local SmithClient = game:GetService'Players'.LocalPlayer.PlayerGui
:WaitForChild("SmithClient");

local EventName = SmithClient:GetAttribute("EventName") or "Action";

game:GetService'ReplicatedStorage'[EventName]:FireServer(Enum.KeyCode.F);

And on the server for your sword:

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

Been a while since I updated this module, it’s got all the features I could’ve hoped for, so I decided it wouldn’t be a bad idea to create a video tutorial for it. Check it our here:

6 Likes

Amazing system, it’s a very nice template when making melee weapons. But it has come to my attention during testing that when multiple tools have Special Abilities bound to the same key, all tools in the Player’s backpack fire off their Special Abilities at once, regardless whether or not the tool is equipped. Was this intentional and I’m missing something crucial or was this an oversight?

1 Like

Arc_Cosine, We are using a custom hit/damage calculator, can we fir this into you system. I notice that you have a fixed damage and critical damage values set up.

If you’re looking to customize your swords further you could change your data table to look something like this:

data = {criticalHits = 45, criticalInterval = 3};
--     How much damage a critical hit deals and how many swings it takes for a critical hit

If your damage values are being calculated differently every time you swing, then you should pass the damage parameter when calling the :Swing method:

Sword:Swing(dmg)

If you’re looking to calculate the damage differently based off differently conditions of the swing, let me know, it may be a little bit more complex

1 Like

Thanks, no we just determine the damage value and pass it, this includes if it is critical or not. So on that note, do we need to include the critical declarations in the data table? it won’t hurt if we don’t use them but just curious.

The criticalInterval key must be declared in the data table to my knowledge, I haven’t worked on this project in quite some time so I can’t be entirely sure. I do plan on creating a v2 in the future.

I wondering if you could add anti Team kill! It would be very cool if there’s!

1 Like

I don’t believe this is currently possible in Sword Smith, you might need to do a little digging into the documentation, but as far as I can see it’s not possible. I probably won’t be updating it to have this feature because like I said

But this probably won’t be done until November or late October.

Thank you for your comment though because I now plan on adding this to the new version whenever it’s coming out!

1 Like

What if I want to change the damage for different sword and is it possible to add 2 Ability into a sword? Also, do we make a new script for special ability or just add into the Sword Script? ;-;

Could this be used to get cash when killed another player? (cash on kill)

To add a custom damage value to your sword you can pass the damage parameter when calling the :Swing method.

sword:Swing(some number);

Yes, it is, you may add any amount of abilities.

You should only need one script for your sword.