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

Why won't local script print anything, not even "Hello World"?

print("Hello World")
local player = game.Players.LocalPlayer
print(player.Name)

When I try to run that code, nothing is being displayed in the output from this local script. There is nothing interfering with the local script (Local script enabled) and the local script is in Workspace.

Is there any reason behind this?

3 answers

LocalScript cannot run if its in workspace

From the roblox 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 Player/Character|character model

A Player’s PlayerGui

A Player’s PlayerScripts

The ReplicatedFirst service

I would recommend placing it in StarterPlayerScripts

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