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

What are LocalScripts for?

Can Anyone please Tell me when and What are the Localscripts For?

2 comments

0

when and what? what: they are scripts that have to be copied onto every player, via starterplayerscripts, replicated first, and some others. when: when roblox studio was made, or after, but does it really matter WHEN they were made?

0

Do you know what a client and server is in roblox?

1 answer

A LocalScript is a script that runs on a client that's connected to a Roblox Server. The wiki article really explains it best and this one's pretty easy to understand:

http://wiki.roblox.com/index.php?title=API:Class/LocalScript

Local Scripts will only run if it's in a designated area. It can be inside the Player's CharacterModel, PlayerGui, PlayerScripts, BackPack, or in the ReplicatedFirst service(Replicates the contents to the client first).

They are copied to every player and allow you to control client-side objects such as their camera.

game.Workspace.CurrentCamera

You can also directly get the player:

local player = game.Players.LocalPlayer or

local player = game:GetService("Players").LocalPlayer

1 comment

0

Oh,Alright! Thank you!

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