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

Local script vs script?

Can you guys give me a few examples of a local script(ranging from easy to hard) with explanation, I read wiki and stuff, but I really need this concept down

1 answer

Local Scripts run Client Side( Which is the Player Only) opposed to Scripts, Bellow I shall do a simple comparison between the 2.

SCRIPT: This runs Server Side in other words Global. And will only run Server Side events and properties, As one of the dis-advantages is that you can't manipulate Client Side and will only run or change Server Side, But it's also quite useful too.

local cam = game.Workspace.Camera
cam.CameraType = "Scriptable"

This will effect everyone on the server.

LOCAL SCRIPT: You can change certain properties that will not show Sever Side which is a huge advantage. Also you can use LocalPlayer, but you it has to be in a tool, Player's Backpack, PlayerGui or in the character if the player.

You can also change the Camera of the player Only with a LocalScript which is also extremely beneficial.

In a local script you can access the player's camera ONLY, I will list an example below.

local cam = game.Workspace.Camera
cam.CameraType = "Scriptable"

This will only affect the player, but it most either be in

StarterGui

Backpack

Tool(Has to be in player)

Or a descendant of either one.

Also if you want to see an example of one of my Camera Manipulation Check Here

That should explain it all.

Many Games have a mix of LocalScripts and Just Scripts.

1 comment

0

so by local script it only affects 1 player? and a regular script would affect all?.. also what do you mean by certain properties you cant manipulate in local?

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