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

Should I use a Local or regular script?

I am going to write a onTouched function and make it change some values located under it when it's touched. Would it work just fine?

1 comment

0

For an OnTouch script, I'd suggest a regular script.

1 answer

✓ Accepted answer

The simplest way to decide is to fist know:-

Thing that need to be local scripts

  • client content such as mouse
  • action which only one user will see
  • lag hiding
  • local parts ect
  • other effects that help performance

Thing that need to be a script

  • secure content such as stats
  • some action that all players will see
  • server related control
  • other game related thing e.g. http service

In short if its doable on the client side for effects and does not need to be transferred to all players or secure the make it a local script.

I do not know your game design so we cannot answer for you.

Feel free to add to this or make changes, just post a comment and I will add it in.

2 comments

0

Thanks that really helped. I think I'll use regular script to keep it more secure like you said.

0

Forgot to add but it is also possible to use both, e.g. for a gun you would have lots of local only effects then send to the server using a remote event or function to check the bullet line.

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