Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to prevent .Touched / PartOnRay delay?

Currently working on a wand - In doing so, the Player equips the wand and it loads a .Chatted function to locate the spoken spell.

The [local] script then fires a ServerEvent (Which is inside the wand) which then locates a Module within the Wand with said spell and fires it.

This goes from local > Server > Module, however the projectile is to remove itself / cause damage upon impact and in doing so is having delays of a few seconds. Was wondering if there's a way to avoid this?

Was going to post the code itself but it's too long.

Thank you!

1 comment

0

Post the code on pastebin then https://pastebin.com/

1 answer

✓ Accepted answer

The delay is not coming from .Touched you will always get a little bit of delay when using PartOnRay but the delay is usually not noticeable when run in a local script, the problem is there is a delay when you FireServer so if possible try to do as much as you can in the local script then validate the information in the server script.

1 comment

0

Thanks! Though I'm not quite sure how exactly to create a spell that should be viewed server-wide, locally, and make it have a .Touched function etc?

This discussion is preserved as it was. New answers, comments, and votes are closed.