How to make a "goomba" like enemy?

I am trying to make a enemy npc which you can beat by jumping on his head. The thing is, I have a transparent part above his head but I don’t know how to make it so that when I jump on it the npc dies. Im not experienced in scripting so I like to build more. I tried looking for a post that answers this question but I couldn’t so I tried making a npc killbrick above the npc which when you jump it falls on the npc but I couldn’t find a killbrick working only on npcs. If anyone could provide a solution for any of these two methods I would really appreciate it since I can’t really continue working on my game without adding enemies.

I think your best bet would be to make it so when you touch that part, it kills the enemy. Then the player will jump on the enemy and touch that part.

You wouldn’t use a kill brick to kill the enemy, thats just inefficient. Instead, whenever you touch the part on top of the enemy, you set the health of the enemy to 0.

The first one was my original idea, the second one is just for cool effects. I would go with what you said but I have no idea how to do that.

Raycast?

One for stomping and one for getting oofed by goomba.

Wouldn’t that only work with the npc kill brick? I took a peek at it on the wiki.

what do you mean?

Just a raycast to aim down from character

and one for pointing at npc.

nothing really different.

Sorry, I dont know much about scripting, much less raycast, so I have no idea how to do that

There are plenty of resources you can find such as on the developer hub or on the literal devforums, all you need to do is search it up.

There are also examples given on how to use them, just alter them and mess around with it to understand or alter them.

Ive been doing that for the last few hours and there are absolutely no examples or posts explaining how to make an enemy similar defeatable by jumping on his head. and I even tried messing around with the sole goomba model in the studio but I can’t make it work. If you know any examples that could help me make an enemy which could be defeated by jumping on its head, please let me know.

Also. do I have to use this “raycast” you speak of? Couldn’t the script just be that the npc which the part is associated with dies when I jump on the part?

You could make it cast a ray down from your player, and when it intersects the part above it’s head have it kill it. You can also set the ray length to very short so it doesn’t kill it before touching it.

I guess I’ll try that, I have 0 experience in scripting like I said but it looks like I have to do it trial by error until I learn
EDIT: Nope, there is no way for me to do this alone, I find this raycast stuff confusing and I dont really know which direction to go since there is no tutorial for a part used to kill npcs

1 Like

Heres a tip:

Do not search for topics pertaining to your issue.

You’re probably searching up “How to make goomba enemies” or something along the lines of those.

Dont to this.

The best course of action would be to split up what you’re aiming for into chunks.

Creating a door with tweens?
Search up tweens
Search up door
Search up hinges
etc

Creating a goomba enemy?
Search up Raycasts
Search up Vectors
etc.

This place is mostly used for pointing into a certain direction, not for somebody to make a script for you.

1 Like

Very helpful dude thanks, especially since I have 0 idea how scripting works so I don’t need a hand at all. Just looking up raycasts and vectors and understanding how they work will give me what I need to know to make my own script from scratch despite having no experience right? I’ll try but since writing scripts is 100% not my thing I will probably waste 3-4 hours on it and learn nothing. I wasnt asking for a whole script, just needed a little push to understand which direction I should take and what commands to use since I mentioned 4 times I have no idea how to script.

1 Like

Oh, if that sounded sarcastic, I wasnt lying, Ill probably waste hours trying to learn how to do this by myself but I have a feeling that will lead me nowhere. Plus do we really have to use raycasting to do this cause I feel like its possible to make a script that on touch by player it kills the npc associated with the part

Using touch will work but will probably show some headaches and issues (hah, goomba headaches-)

Basically, it can act up sometimes, you’ll probably have more success with raycasts.

I did it, I made a killbrick that only works on “zombies” thats what I call the humanoid part to differenciate them from the player, now I need to make so that if I jump on it, it falls down

How do I make it so that it follows it and stays up cause it doesnt follow it just floats

Christ, dude. You are on a scripting forum for people who are willing to actually learn things.

They are not here to make scripts for you, if you want it done for you, hire someone.

But I recommend you actually learn programming yourself, and the fundamentals, it won’t kill you and you get more value from it then just one goomba script.

This stuff is hard for you because you don’t know the fundamentals. Raycasting is incredibly simple, its just that you need to know the fundamentals first, functions and triggers are a good place to start.
And for your part problem, Look up part welding.

It doesn’t take hours, look up a video or two. Most of these concepts take 20 minutes at most to understand if you’re willing to learn and need to script multiple things.

Or, if you want, you can hire me or many others for a robux or money price per script.

I can do it for you at a pretty low price wink wink

3 Likes

You want help? Send us what you tried.