Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Jackd44 35
10 years ago

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.

0
Try putting a print above all of the variables. See if the script even reaches that print. AmericanStripes 610 — 10y
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? Bubby4j 231 — 10y
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 Jackd44 35 — 10y

Locked by MrNicNac

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

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.

0
Hello, thank you for your reply. However, I've already tried this. :P Jackd44 35 — 10y
Ad