Is it server sided or client sided?

This tutorial should help you help others script on the devforum. If the writer has not specified the type of script they are showing… this will give you clues on what to look for to tell if a script is server sided, or client sided. Then, you won’t have to ask the writer yourself!

I see people asking all the time, when clearly it’s one or the other. That’s the motivation behind this tutorial!

Client Sided Script?

If you see one of these lines, it is definitely client sided:

game.Players.LocalPlayer
game:GetService("UserInputService")
game.ContextActionService
game:GetService("RunService").RenderStepped
game.StarterGui:SetCoreGui()
game.StarterGui:SetCoreGuiEnabled()
game.GuiService
game.VRService
game.ContentProvider
RemoteEvent.OnClientEvent:Connect()
RemoteFunction.OnClientInvoke = function()

Server Sided Script?

If you see one of these lines, it is server sided:

game.HttpService
game.ServerScriptService
game.ServerStorage
game:GetService("DatastoreService")
game:GetService("MessagingService")
game:GetService("MemoryStoreService")
Instance.new("RemoteEvent")
Instance.new("RemoteFunction")
RemoteEvent.OnServerEvent:Connect()
RemoteFunction.OnServerInvoke = function()
game:BindToClose()

-- Possible on client, most likely on server:
game.Players.PlayerAdded
game.Players.PlayerRemoving
player.Chatted
player:Kick()

-- Possible on client, only makes sense on server:
Object.Parent = game.ReplicatedFirst
Object.Parent = game.ReplicatedStorage
Object.Parent = game.StarterPack
Object.Parent = game.StarterGui

Module Scripts

I don’t say ‘server script’ or ‘LocalScript’ because of modules. They can be run both on the server and client. If you have not tried object oriented programming, I strongly recommend it, even if you’re new (but not brand new) to scripting!


However, if you see a server sided line AND a client sided line in the same script, you should ask the writer what type of script it is.

For example, this code is wrong:

local player = game.Players.LocalPlayer
local objects = game.ServerStorage

It’s most likely client sided, and the writer tries to use ServerStorage incorrectly.

local DSS = game:GetService("DatastoreService")
local UIS = game:GetService("UserInputService")

It’s most likely server sided. DatastoreService is only available on the server, you get the point.


If there are no clues on what type of script it is, then maybe go off of what the writer is trying to make. It’s less reliable though, they could be new and not know the difference between the server and the client.

You’re the Writer?

If you’re the one posting code, you should take a few seconds to say what type of script it is to invalidate this tutorial completely. There’s a few different ways I’d go about it.
You wouldn’t need to do this if your changing somebody else’s script, since they already know what the type is.

Writer Examples

Here’s my code! Why is it erroring?

-- Client Sided:
local player = game.Players.LocalPlayer
-- other code

Here’s the code:

-- Server Sided:
local templates = game.ServerStorage.Templates
-- other code

I need help with my datastore system! It’s a running server sided in a module.

local Shop = {}
-- other code
return Shop

Replace that code with this:

return a + (b - a) * delta

It wasn’t working before because you were dividing instead of multiplying!


Hopefully now you can identify quickly what type of script somebody sent!
Thanks for reading.

8 Likes

Nice tutorial! It definitely gives lots of clarifications on what is server-sided and what is client-sided. :slight_smile:

I have a few things

You should put RemoteEvent.OnClientEvent:Connect() in the client-sided section.

According to the documentation, creating a RemoteEvent and RemoteFunction Instance can be done on the client and the server.

1 Like

I will do that!

It only makes sense when creating it on the server, that’s why. Client sided remotes are useless!

1 Like

This tutorial is quite misleading and some things are outright wrong. This isn’t a necessary tutorial either as things become quite self explanatory once you use it. The information provided here is also quite limited.

You can’t “tell” if a snippet of code is server or client sided, you can only take an educated guess to which one it is.


These snippets are examples of overt, incorrect information labelled.

1 Like

It’s just the way I quickly figure out the type of script it is. When I can guess, I guess correctly. Some of the things you pointed out like game.StarterGui can of course be used on both sides. It’s just much more likely to be on the client, because of StarterGui:SetCore() and StarterGui:SetCoreEnabled(). I could put that as well, but it would start to get messy!

There’s tons of different methods that are only allowed on one side, but again it would get messy.

If you have your own way of figuring out, you can go with that instead. Thanks!


edit: I don’t understand what you mean here, could you elaborate?

It’s just an example, after all.

1 Like

Shouldn’t only LocalScripts use ReplicatedFirst?

Yes, but only the server would be putting things inside ReplicatedFirst.