Writing an FPS framework, part 2 (2020)

image

Alright, didnt know about that

Is there a way to add items, such as. Knifes, Grenades, etc. (sorry if im bugging you, i like this fps framework)

I did it by splitting the controller into multiple. Instead of one that is always referenced the same, keep a main one with movement (sliding, leaning, crouch, standard viewmodel control), and others that are referenced per each weapon type. Equipping a rifle? connect a keybind map for the rifle (for shooting, aiming) that references functions FOR shooting and aiming. same for grenades, melee. I didn’t do this in the tutorial because in January i still used just one controller with abhorrent support for other weapons, and because it’s pretty complex in the way i did it. Only 2 weeks ago did i rewrite my framework to support anything other than guns.

https://gyazo.com/71eba6afcd16788da242d1a892f3e0de i get that when i try to fire, it was worked before but suddenly it stopped working.(also im spam clicking)

i fixed my problem, it was a rpm issue

Why does the in game animation not broken, but in studio, its broken even if you publish and go to the game you’ve published it in

You need to convert the animations

1 Like

Thanks, but, there’s some parts in part 1 and this part which I cannot understand, I would need a video to make this, I really sound dumb, I am sorry if I really do look dumb.

For multiple guns, if you swap to a gun with higher RPM, you cannot fire until the cool down for the gun with lower RPM ends. Is there a way to fix this?

self.canFire = true when removing/equipping the gun.

1 Like

Hello! Thanks for the tutorial, but I got a question. How do you put more weapons in? I tried but it didn’t work.

Reply or DM me on roblox devforum, Thanks!

Problem fixed.

(30000characters)

1 Like

Really great and up to date tutorial, however when I added my gun it is not pointing in the right direction, do you know how to fix this?


and it also doesn’t show bullets for some reason.

1 Like

edit the animationsimage

This was a great tutorial series! I’ve really enjoyed creating my own system off of this one, as it’s flexibility is wonderful! I do have one small nitpick however, which I’m not sure if it is a typo or not:

remotes:WaitForChild("hit").OnServerEvent:Connect(function(player, humanoid, headshot)

	if not players[player.UserId].currentWeapon then return end
	if not player.Character then return end 
	
	if headshot then 
		
		humanoid:TakeDamage(players[player.UserId].currentWeapon.settings.firing.damage)
	
	else
		
		humanoid:TakeDamage(players[player.UserId].currentWeapon.settings.firing.headshot)
		
	end
end

Just a small thing, really. It appears that the headshot and normal damage is flipped. Putting this here so people who might have missed it in their own framework fix it.

In any case, thank you so much for making this framework! My only real question about it is this:

Is there a better way than simply eye-balling the offsets? I’d like to do precise alignments for offsets other than the aim offset, but I’m finding it relatively hard.

Thank you for two great tutorials!

1 Like

I used the wrong order? wow.
At the very least it’s placeholder code.

The way offsets are done is pretty much what I’d call flexible, although not user friendly. If i get fed up with it when making new weapons for my own game I will publish a plugin for everyone to use.

I finished this tutorial a while ago and skipped animations because I figured they could wait. I’ve finished my own edits and security updates, but now I’ve realized that I can’t seem to properly animate the viewmodel. Because the gun’s contents get merged with the viewmodel, Moon Animator is only picking up the arms as objects that can move. This makes creating a reload animation impossible. Do I have to re-rig the viewmodel once I copy it from camera? I feel like this would break it, or simply not run animation properly.

the gun’s contents merge with the viewmodel to be animate-able. i ran into issues back in 2019 when trying to just parent the gun model inside the viewmodel. I don’t know what to say without seeing your own game setup.

i got stuck at the part where gun should holster to my back (after you weld weaponhold and backweld and then create server script and edit inputController). I got this error when i run the play. The script with error is exact copy of what you did but with the different gun name.

error

The syntax highlights error (unknown global “player”) at players[player.UserId]. Was it supposed to be like that?
Do i have to define players? I dont get it.

2 Likes