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

Which way of making a projectile causes less lag?

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).......)

2 comments

0

Not really, you probably just have an extra wait() somewhere or something. Post the code.

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

1 answer

✓ Accepted answer

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.

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