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

Which way of making a projectile causes less lag?

Asked by 9 years ago

I started scripting a laser gun but I have a problem with it - In multiplayer/uploaded place the lasers show up about 0.5 seconds after clicking the shoot button. To make the bullets I am using this: local laser = ServerStorage.Laser:clone()

Is making the laser projectile inside the script instad of cloning fro mserverstorage less laggier? (local laser = Instance.new("Part", tool).......)

0
Not really, you probably just have an extra wait() somewhere or something. Post the code. Perci1 4988 — 9y
0
When I use the gun in studio test mode it has no delay but when I upload it and use it in a place it does CodeSponge 125 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I expect it's lagging because you've trying to access ServerStorage, probably from the client side. When you're testing locally (in Studio/Play Solo mode), this communication is instant, but it takes time in multiplayer when your computer has to communicate with one of Roblox's servers over the Internet.

Try putting the laser in "ReplicatedStorage" -- that means the laser will be distributed to all clients, so you don't have to ask the server for a copy of it, you'll already have it.

Ad

Answer this question