Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 15 Dec 2013 05:05 PM |
I haven't scripted in a while, and I might just not be noticing something utterly stupid but my script I just made that supposed to clone another script into a player when they enter the game doesn't seem to be working, the output says nothing :/ Here's the script:
script = game.Lighting.TitleScript function added(plyr) news = script:clone() news.Parent = plyr end
game.Players.PlayerAdded:connect(added) |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2013 05:07 PM |
Two possible solutions: 1. Try using ReplicatedStorage instead of Lighting 2. Put the Script inside of the Player's PlayerGui or Backpack
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 15 Dec 2013 05:09 PM |
I'm not sure what happens when you set script as a variable... Try changing the variable name to newScript or something... and also Disable the script you're copying then undisable it after you parent it?
Or the script is... well... "dead". |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 15 Dec 2013 05:10 PM |
Neither of those worked :/ And by the way, what is ReplicatedStorage? I was inactive for about a year and I guess I missed when they put that in. |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 15 Dec 2013 05:12 PM |
@wazap, I changed the variable name and nothing happened, and the problem I'm having is that it's not even cloning it there, not that it's not running. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2013 05:13 PM |
Huh... is your script inactive when you clone it?
ServerScriptStorage: You should put all Script objects in here that don't reply on specific parts. They cannot be modified/stolen because they only exist to the server. Scripts put in here will run. ServerStorage: You can put objects here that you will only be using with the server (normal Scripts). Scripts put in here will not run. ReplicatedStorage: Basically, Lighting. Scripts in here will not run, and the objects in here will be available to everyone.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 15 Dec 2013 05:15 PM |
@ DaMrNelson No, I just added a part to make sure it's active before it clones it and still nothing, could it be that I'm testing it in Play Solo? I've had some problems with that in the past. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2013 05:20 PM |
Ah yes, that could be it. Try it in Tools -> Test -> Start Server, then Tools -> Test -> Start Player
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 15 Dec 2013 05:24 PM |
Ok I tried that and something appeared in the output, saying "PlayerGui is not a valid member of Player" Ya... This is confusing me now, since I know PlayerGui is a member of Player :/ Perhaps the playeradded connection is setting plyr to the Character of the new Player? |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2013 05:26 PM |
Try using Player:WaitForChild("PlayerGui") before using any references to it.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 15 Dec 2013 05:28 PM |
| Aha! It finally worked, thanks! |
|
|
| Report Abuse |
|
|