Re-written Versions Of The Roblox Battle Weapons

As part of an upcoming project, I needed to re-write the weapons from Roblox Battle. I did this in 2015, but they had a lot of bugs, and some of the weapons had a noticeable latency. I decided to make these free as of today. All code is free to use, modify, and publish, and comments have also been included if you are trying to learn scripting with existing code.

As a note for R15, I have animations set up, but you will be unable to use them because I can’t make animations public. See: Public Animations.
For now, here is the animations that can be re-uploaded: R15 Animations.rbxm (24.5 KB)

Models:

49 Likes

Are they FE compatible?

3 Likes

Yes. Basically a given now because of the changes regarding Experimental Mode.

4 Likes

Thank you! I’ll be sure to utilize these if I need to!

1 Like

Mind saving (not exporting) them and attaching as an rbxm here? Then other developers can publish those under their account, change the IDs of the tool animations, and then use the animations in their games.

4 Likes

A model file has been added to the OP with the animations.

4 Likes

I really love what your doing; with those weapons I hope your weapons turn out great!:grinning:

1 Like

Sweet.

I’m sure if you asked around you’d be able to get the animations transferred to the Roblox account so anyone would be able to use them.

Possibly, but it doesn’t address the problem for other people want to make R15 free models.

1 Like

Of course not, but until that is addressed you won’t have many options.

Thanks! This is cool! I think @2Hex and @Thundermaker300 would love this

2 Likes

yes

1 Like

FYI you forgot to disconnect your InputBegan/Ended/Changed events in your tool’s InputHandler module. Replace InputBegan in the module with:

UserInputService.InputBegan:Connect(function(Input,Processed)
	print("A") -- just print A whenever we do input
	if Processed then return end
	local Character = Player.Character
	if not Character then return end
	local Humanoid = Character:FindFirstChildOfClass("Humanoid")
	if not Humanoid or Humanoid.Health <= 0 then return end
	
	--Register event if it was a mouse left click.
	if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
		local Position = Get3DPosition(Input.Position.X,Input.Position.Y)
		LongInputBeganEvent:Fire(Position)
		
		if Input.UserInputType == Enum.UserInputType.MouseButton1 then
			InputBeganEvent:Fire(Position)
		end
	end
end)

The first time you spawn, it will print A once when you click, the next spawn you spawn, it will print A twice, then 3 times, etc.

This is bad since developers tend to make players spawn with ALL tools at once, so the first time your character spawns, you’re casting 5 rays per click, then 10, then 15…

6 Likes

I have made a change to address this. I need to look into it, but there may be a bug where LocalScripts aren’t properly destroyed when the player respawns.

3 Likes

A connection persists even if the script that created it is deleted. Create a simple script that prints the time every heartbeat:

game:GetService("RunService").Heartbeat:Connect(function()
    print(tick())
end)

Run the game and delete the script. The time should still be printed every heartbeat.

Even the default animation script disconnects all connections manually when the player dies.

Never mind, this doesn’t seem to be the case!

4 Likes

I got the R15 animations to work, but this happens…

https://i.gyazo.com/1d886298e2a0964a24075cc886142cdf.mp4

What is causing this to happen? I didn’t modify the animations when I exported them to Roblox.

This looks specific to the idle animation. You could have the wrong id set up for it or uploaded the wrong animation, or the idle animations could just be broken. It isn’t something I can easily resolve unless it is the animation or code being broken which would manifest in Roblox Battle (2018 Edition).

1 Like

I kinda fixed it myself by modifying the animations, for the holding animation I just set it to loop on 1 keyframe and that worked. I also removed the torso and head keyframes from the other animation and now it looks better.

There is a new bug I encountered where the tool animations work just fine when I test in studio, but then when I publish the game and play it then the animations do not exist in the tools. They are my uploaded animations, I have other R15 animated tools in the game that do not have this problem so I don’t know why it happens like this for these tools. All of the tools are kept inside a folder in ServerStorage. When I put the tools in StarterPack and then publish then it works though.

Sorry to reply to an ancient post, but when I tested this, the connection was disconnected.

1 Like