Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to prevent .Touched / PartOnRay delay?

Asked by 5 years ago

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!

0
Post the code on pastebin then https://pastebin.com/ WideSteal321 773 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

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? KossmoZ 4 — 5y
Ad

Answer this question