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

[SOLVED]My local scripts aren't printing, anyone know why?

Hello, sorry if I'm not doing this right, I'm new to SH. But, I have a few local scripts(that actually have a multitude of bugs, but anyway...) and they're not wanting to print to the output, either output. For example, even this doesn't work.

wait()
LocalP = game.Players.LocalPlayer
LocalP.CharacterAdded:wait()
Char = LocalP.Character
print("Variables set")

Now, that's pretty much what all these problems are like. Sorry if my code is bad, I'm still fairly new to scripting. But yeah, script is located in StarterGui for now(StarterPack didn't seem to want to work either), and they're all localscripts. If you have any other questions you'd like to ask, please feel free. However, as of the time of writing this thread, I won't be able to post back for a good few hours.

SOLUTION: The problem was that the player had spawned prior to the script loading, meaning the "LocalP.CharacterAdded:wait()" line would jam up the whole script.

3 comments

0

Try putting a print above all of the variables. See if the script even reaches that print.

0

Is it possible that by the time the script runs that the character is already loaded, and so CharacterAdded:wait() won't fire until next time they respawn?

0

Thank you both for your comments, Creative, I did that and it helped. However, it only helped after I used Bubby's advise and removed CharacterAdded. The scripts all now work, thanks so much for the help. :D

1 answer

LocalScripts don't print to the Server's Output. If you test using Test->Play Solo then they will, because the client and server are one and the same. If you test using Test->Start Server=>Start Player then LocalScript prints will appear in individual Client Outputs.

1 comment

0

Hello, thank you for your reply. However, I've already tried this. :P

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