Okay, so I want to clone a localscript from a script in Workspace and put it into a player's StarterPlayerScripts class. I know that the method to do this is to assign the cloned script a new parent saying "script.MYscript:Clone().Parent = _____" except I'm not sure how to fill the blank. I have tried many things, but I either get an error (object is not a valid member of object) or I find out that the cloned script doesn't work the way it should. Please note that I only want to send the script to one player, not all of them at once.
I learned that "script.MYscript:Clone().Parent = Player.PlayerScripts" will not work on account of an error that says, "PlayerScripts is not a valid member of Player." I also added a remote event with a "player" parameter shown below, though I am unsure if this helps or hurts my code. Thoughts/Ideas?
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
print(player.Name.." will now receive a script.") script.MYscriptl:Clone().Parent = _________
end)
Put the script in StarterPlayerScripts, but then use a RemoteEvent (or two) to travel through the two scripts. Then instead of duplicating it into PlayerScripts, have it already in there (as said in first line) and only have the script do what it needs to do on the remote event. Im not the best scripter so I use 2 remote events (server -> Client -> server) but its not very smart. Use a BindableEvent (I think) to travel between 2 server scripts.