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

Should I use a Local or regular script?

Asked by
StoIid 364 Moderation Voter
8 years ago

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?

0
For an OnTouch script, I'd suggest a regular script. Scootakip 299 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

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.

0
Thanks that really helped. I think I'll use regular script to keep it more secure like you said. StoIid 364 — 8y
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. User#5423 17 — 8y
Ad

Answer this question