I wanted to ask the talented people of DevForum for some help. I’m realatively new to scripting and make many mistakes and don’t know a lot. In the Gyazo link I attached, I show off a script I’m working on. It’s a “Domain Expansion” from the series Jujutsu Kaisen that is a non-canon Domain Expansion and the red orb you see go from top down is a hitbox that I want to have it detect who is in my domain’s range, the hitbox doesn’t last too too long, but it’s just enough to hit anybody who’s in my range and then have it fire to client to play some particle effects, but for whatever reason, the hitbox, no matter how I make it, it doesn’t detect ANYTHING and doesn’t hit anything.
What I’m asking is, does anybody know what would be the best course of action to accomplish a task like this, ignore how the orb moves and how it works, I’m stupid when it comes to this. What system would you personally use for something like this? Magnitude? Touched? ZonePlus?
What I’m trying to accomplish: Create a hitbox that lasts like 0.1 second and whoever it hits within the range of my domain, it remote events to all clients to enable some particles. I apoligize if this is a lot to read. I’ve just hit a brick wall and don’t know what to do.
(PS. Not asking for you to write a long code for me, I don’t want you to waste your time, if you read this at all, I just want opinions and advice on how to go about this)
If you read all this and even just took the time to register all this, thank you for your time.
If all you need to do is create a sphere, check for collisions, and then destroy it, you could just Instance.new a part, set its properties, connect a .Touched event to a function that fires all clients, use the Debris service to automatically destroy it after a period of time.
Also, if you’re firing all clients just to enable particles, why not do it on the server instead?
I was trying to do touched previously but for whatever reason it doesn’t detect anything. and I also am doing it client sided and not server sided because from an outsider prespective, the particles stick out a lot and look weird but to someone INSIDE the domain it looks cool and makes sense, so the POV.
I wouldn’t recommend using Touched since it can be pretty unreliable. Instead you should check out Workspace:GetPartBoundsInRadius() which you can pass a Vector3 Position (center of the sphere) and a radius you want to check in!
Once you do this on the server, you should get an array of parts inside the sphere which you can loop through and if it is a HumanoidRootPart you can fire the client for that character!
Hope that helps, let me know if you have any questions