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

Localscript won't start to run for no reason?

I have a local script with a stringvalue and 2 boolvalues inside of it. The localscript is inside a model that is inside replicated storage. Eventually a textbutton causes the model to be put inside workspace.CurrentCamera.

Disabled is set to false and filteringenabled is also set to false

The very first line of the localscript is

print("Starting")

It doesn't show print("Starting") anywhere in the developer console, and it doesn't give any errors. None of the other lines of code after it run either.

2 comments

0

show us more code so we can help find the problem

2 answers

✓ Accepted answer

Hello, blowup999

The problem is the parent. LocalScripts does not run inside workspace.CurrentCamera so maybe you should replicate it somewhere else.

~Radio

If this helped you, accept and upvote, it helps both of us :)

Your problem may be that localScripts only run inside specific places in the game.

From the wiki:

A LocalScript will only run Lua code if it is a descendant of one of the following objects:

A Player's Backpack, such as a child of a Tool

A Player's Character model

A Player's PlayerGui

A Player's PlayerScripts

The ReplicatedFirst service

Note: the parent of the LocalScript will determine which client the Lua code will be executed on.

Try putting the script into the player's scripts or ReplicatedFirst, and it should work

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