LocalScripts placed in the Workspace do NOT work

For a week now, trying to code with LocalScripts placed under the Workspace simply does not work. I have absolutely no idea why, or how did that happen. I was doing a project, had an issue, decided to write a post in the forum for it, but gave up halfway through and just decided to start over, and since then, things stopped working.

Not a single LocalScript placed under a child of the Workspace, or as a child of the Workspace will work. They’re not even read, its almost as if Roblox Studio completely ignores any LocalScript if placed under Workspace — which, of course, never happened until a few days ago.

I’m not even sure of how to describe this issue, so I’ll just show it instead in the following links.

Just when I was starting to make progress, too. As far as I remember, I didn’t mess with any settings at all, and even deleted the old place I was working with to start completely from scratch, and the issue persisted. Any help is appreciated.

First, just by reading the Title alone.

There’s nothing else to say besides you CANNOT run a local script inside workspace only within a character

But ill take a look at these things you’ve linked

Edit: here’s the documentation for local scripts LocalScript | Documentation - Roblox Creator Hub
I suggest you learn more about the relationship between clients and servers its a rookie mistake but that’s alright never be afraid to ask questions

1 Like

try placing it under StarterCharacterScripts

He was just wondering why local scripts do not work outside of clients.

Edit: He isn’t familiar with the Server-Client Relationship and why its a local script

If you want a local script to work in a place that is not under StarterPlayerScripts or PlayerGui, you will have to use a server script and then set it’s RunContext to Client.

3 Likes

yup, this is why RunContext was a mistake
it creates confusion and makes people think they can run localscripts under workspace outside of player’s character.

That doesn’t make RunContext a mistake, it’s just beginners being confused

2 Likes

i know, i was merely joking when i said that.

I used to be completely dumbfounded by RunContext, but with time comes wisdom. One day, it just clicked, and I understood it instantly!

Local scripts can NEVER run in workspace. The only way you can do this is to create a script and set the RunContext to Client. Remember that a local script should only be able to run in client controlled environments and manipulate objects that the client created itself.

Here are some useful articles for understanding the server vs client:
Working with the Replication Boundary - Resources / Community Resources - Developer Forum | Roblox

Client-Server Runtime | Documentation - Roblox Creator Hub

Network ownership for beginners - How to handle physics on the client - Resources / Community Tutorials - Developer Forum | Roblox

Apparently, I’m burnout and fell for the Mandela effect of being 100% sure that I’d frequently use LocalScripts for coding instances within the Workspace.
After the replies, I went through all of my archived places to look for LocalScripts under the Workspace to prove everybody right, and ended up making a fool of myself — to myself.

Oh, well. Guess I’ll take a break then. Forgive the stupid post.

It is fine; we have all been through this stage of coding, and you will get over it quickly, and it’ll be like it never happened.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.