Relative Content

Tag Archive for luarobloxluauroblox-studio

How to go about making hitboxes in Roblox

Lately, I had been trying to figure out how to make a decent hitbox system for my game. My inspiration is “Item Asylum”. What I had noticed is: The hitbox doesn’t move with the player, instead multiple are created and as well as I can understand, destroyed. That’s no the tricky part, the tricky part is: making it not damage the person who activated the ability / created the hitbox.
Or, do I just make it move with the character (which will probably a worse decision since exploiters can use that to their advantage.)

How to go about making hitboxes in Roblox

Lately, I had been trying to figure out how to make a decent hitbox system for my game. My inspiration is “Item Asylum”. What I had noticed is: The hitbox doesn’t move with the player, instead multiple are created and as well as I can understand, destroyed. That’s no the tricky part, the tricky part is: making it not damage the person who activated the ability / created the hitbox.
Or, do I just make it move with the character (which will probably a worse decision since exploiters can use that to their advantage.)

Stamina bar going from 100 to 0 for no reason, Stamina value not getting any interactions

For some reason whenever I launch my experience, like a second or a half passes and the bar goes from full to empty. I also can’t make any interactions with the value. (example: whenever I try to make a if condition that if it’s equal or less than 0, then it stops doing the punches. It works, but, when I try to make an if that has the condition of it being less than a hundred, that waits for 0.2 seconds, and adds 2 to the stamina value.) If I made a repeat until it’s 100, then it just starts to increment onto it for no particular reason, no matter the condition.
Maybe someone knows the answer?
ModuleScript:

All ModuleScript variables == nil

For some reason, my local variables in the module script all seem to be nil, with no exact explanation for it, or solution.
Local Script (Stamina bar Script):

Why doesn’t my Roblox Studio print script execute correctly

For some reason, my pretty short script just refuses to print out or do anything after declaring variables, does anyone have an answer? I think it may actually be the wait for child and wait() but I don’t know, because I just started Lua.
Code:

How to type annotate a Module Script in Luau?

I’m currently making a strict type checked script but can’t find a way to type annotate a variable that requires a Module Script without using the type any which is bad practice.