Writing an FPS framework (2020)

whenever i play the game in studio it looks like this
https://gyazo.com/8bec8934fb7eb5595ea389c265f718cf
heres the error log:
https://gyazo.com/b2fd49cb806daf8ecf3280f3e6671a11
I tried exporting the idle animation as my own and changing the idle animation id in the viemodel. But it didnt work. I have no clue what to do. Help!

6 Likes

Hi, I would like to thankyou because this is truly amazing and its very well written and helpful, I was wondering how we would go about detecting if the player got a kill. If anyone could help my out please let me know. Thankyou.

when dealing damage, check if the humanoid has no health left and just give the player dealing damage a kill.

So Iā€™m really confused on Part 6 and 7 where you say on the script you are gonna add a FPS module and then in the next step the FPS module is already there. I donā€™t know if itā€™s just because Iā€™m stupid enough but can you clarify where you got the FPS module or tell me where in the post did you make a module name it and scripted it because Iā€™m really confused sorry.

the beginning of the code samples should tell you the name and whateverā€™s put inbetween should help too. otherwise just check how itā€™s done in the demo place.

1 Like

Thereā€™s a problem with step 7 with the final offset. So basically on the final offset part of the script, there is an error that the output points out which is that Iā€™m trying to ā€œattempt to index nil with 'offsetsā€. Iā€™ve been trying to fix this myself but to no avail. (And yes I looked in the open-sourced game and still nothing) Sorry for replying twice but I have no clue, help!

image

screenshot of the line that causes the error?

EDIT: the line where the final offset is

EDIT 2: as well as the idleOffset line

Iā€™ve finished this tutorial and part 2, while skipping unnecessary animations with the idea Iā€™d just do them later. However, I was wondering how you had the viewmodel rig set up to animate in that one screenshot, my viewmodel makes it so I can only animate the arms, which isnā€™t ideal as I would like to animate the magazine and the bolt of the gun. The gun is rigged correctly, but when it gets merged with the viewmodel the hierarchy in Moon Animator is just weaponRootPart > right / left

Hey, amazing tutorial!

local enumBinds = {
	[1] = "One";
	[2] = "Two";
	[3] = "Three";
}

About it, why using [1] =
xD, sorry for the comment, but, index getā€™s automatically assigned, so no need to do this

local enumBinds = {
	[1] = "One";
	[2] = "Two";
	[3] = "Three";
}
print(enumBinds[1])

Because is equal to this:

local enumBinds = {
"One";
	"Two";
"Three";
}
print(enumBinds[1])
2 Likes

your choiceimage

2 Likes

Iā€™m more of a visual learner and I was hoping that someone could send me a video on how to set this up and animate it.

1 Like

I spent hours trying to make this and couldnā€™t get it to work for some reason. Then I noticed you had an uncopylocked version :sweat:

But on a serious note this is an amazing tutorial well done I loved it.

1 Like

This is a very in-depth guide and I have found this very useful as I have been confused as to how I should start creating a framework from scratch. This is a great tutorial and I will share this with some of my friends! Keep up the good work! :slight_smile:

PS: I know Iā€™m late to find this but Iā€™m very appreciative.

This will improve my in game graphics right?

Hey i have an issue with the arms, the weapon and the equipping work perfectly fine, but the arms just donā€™t connect.

https://gyazo.com/5a8fb604e57eeeb040a01b371b490fe6 ā€“ The gif

0ed12991dadcbac7177ae294531b8305

weaponā€™s part0 is rootPart, and for left and right parts nothing is assigned to the mt6dā€¦

Edit: btw the script is like this.

	self.viewmodel.rootPart.CFrame = CFrame.new(0, -100, 0)
	self.viewmodel.rootPart.weapon.Part1 = self.viewmodel.weaponRootPart
	self.viewmodel.left.leftHand.Part0 = self.viewmodel.weaponRootPart
	self.viewmodel.right.rightHand.Part0 = self.viewmodel.weaponRootPart

Thanks in advance?

EDIT: i fixed it, i just welded the parts lol

1 Like

What if i wanted to make a better springs module what should i add in?, also whatā€™s the idea of your shove function?

  1. I havenā€™t used other spring modules at all, so i canā€™t say.
  2. :shove() just bonks the spring in a given Vector3 direction as hopefully explained in the tutorial