Log in to vote

Local script vs script?

Asked by 7 years ago

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

Log in to vote
Answered by
HexC3D 830 Moderation Voter
7 years ago

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



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.

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? namelessassasin 30 — 7y

Answer this question