Print not working

Recently I’ve been using the print() function to ensure my code works, however regardless of if the script works, print() does not work. Here’s a script of mine that I know works that I added a print() function to to make sure print() is working:

game.Workspace.Level0Music:Play()
print("Output works.")

And here’s the output:


(This isn’t the whole output but even when I scroll up I can’t find any script outputs)

3 Likes

Can you provide more details regarding your script?

1 Like

i can you provide more details?

Did you make sure this script actually has print lines??
Send us a copy of the script

Another thing is scripts tend to stop if they have an erro
It also could be because of a line typo or because of a declared variable or function that doesnt exist

My first answer would be is, It did print but you need to scroll up/down in the output console. My second answer would be that (look at the code)

game.Workspace.Level0Music
-- The thing above doesnt exist (nil) which stops the script
-- since it stops the script the print function wont work
1 Like

But then they would get the error attempt to index nil with Play

But what could be the problem then?

I got something which could be you disabled client and server messages.
ORRR you placed a server script in a place it cant work (Yes server scripts runs on the legacy runservice meaning you need to put it in a certain place like “ServerScriptServices” or “Workspace” and etc.)
A way to fix this thing you can change the runservice (which is located in the script properties) to server.

image
image
The “StarterPlayerScripts” cant run legacy runservice scripts, So i used it as an example
image
See?, The script with runservice set to server is the only one which printed (Yes i did check all of the console)

The script literally just plays music it’s that simple and it works fine but the print does nothing

Look at the post.

Script is in ServerScriptService.

Then it prob could be that you disabled the server in the output context thing

No I have everything active and I’ve checked the server’s output too there are no print outputs anywhere.

Hmm, I dont have any other way to fix it, Sorry!

Try this:

game.Workspace:WaitForChild("Level0Music"):Play()
print("Output works.")
  1. Try to print in line 1
  2. check if the script’s location is placed right

And the locations for scripts are:
LocalScripts: PlayerGui, PlayerScripts, ReplicatedFirst
ServerScripts: ServerScriptService

  1. Check if the script actually running via script monitor

The music works fine though, it’s the print that doesn’t work.

Why’d you need the print statement if the script works?

The only thing that I can imagine causing this issue is that you do not have all contexts enabled in your output window. You have to make sure that the Server or Client context boxes are ticked.

Example with a server script print:

image

image

image

image

Elaborate.

It’s in ServerScriptService.

The script does run because the music plays.

Search on output about the message you printed, because you have alot of plugins that errors and prints.

1 Like

Because I tried using print to debug other scripts and it wouldn’t work so I tried it in a script that I know works to see if something’s wrong.

I scrolled all the way through it’s nowhere to be found.