generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

what is the most efficient/lagless method of doing this?

Previous Thread :: Next Thread 
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
23 Jul 2017 11:52 AM
i am in the process of scripting a vehicle. now when you enter a vehicle, you will be able to do different controls such as speed up the vehicle, have it follow the mouse cursor, fire with weapons, etc. all this requires the usage of events. the question is, should i use the :disconnect method on the events every time i exit the vehicle, or should the events always be connected but have an if statement so that it only works while inside a vehicle?
Report Abuse
DoctorFartPhD is online. DoctorFartPhD
Joined: 02 Jan 2013
Total Posts: 40
23 Jul 2017 12:10 PM
You cannot use mouse events on the server. A common way to handle the controls of a vehicle is for a script to inject a local script into the character that sits on the seat. Removing the script when the character leaves the seat will terminate all the connections. It is more efficient to disconnect the event that run logic inside of it, especially if it is being done for multiple vehicles.
Report Abuse
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
23 Jul 2017 12:13 PM
what do you mean "cannot use mouse events on the server"? also, are you certain it is best to just insert the localscript?
Report Abuse
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
23 Jul 2017 01:53 PM
.
Report Abuse
doggy00 is online. doggy00
Joined: 11 Jan 2011
Total Posts: 3571
23 Jul 2017 01:54 PM
He means the player's mouse and other types of input can only be accessed via local scripts, not server scripts.
Report Abuse
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
23 Jul 2017 02:37 PM
that's obvious. why is that being stated? also, is putting a localscript inside the character the best approach to this?
Report Abuse
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
23 Jul 2017 02:38 PM
i dont use the natural roblox seats, if he thought i was doing that. i enter vehicles through a local system and then teleport the player into the vehicle through remotes
Report Abuse
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
23 Jul 2017 04:06 PM
..
Report Abuse
francaiscanada10 is online. francaiscanada10
Joined: 05 Feb 2013
Total Posts: 135
23 Jul 2017 04:38 PM
either way it won't really affect much unless you have the worst computer in the world, but if I would have the choice I would disconnect all the events. An easy way to do that is create a table for your connections and when you get out of the seat it ########### everything inside of that table and resets it
Report Abuse
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
23 Jul 2017 04:50 PM
that's one of the options. isn't the adding a localscript in the character better? if you were gonna make a professional popular game, what would you do
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image