Hello! I am trying to clone a ModuleScript into either StarterPlayerScripts, or PlayerScripts, yet it is not working.
I am using a Child Script in the Module Script currently (not working, incase you didn’t get that before)
local module = script.Parent local moduleclone = module:Clone() local Players = game:GetService(“Players”) Players.PlayerAdded:Connect(function(player) local scriptclone = script:Clone() scriptclone.Parent = player:FindFirstChild(“PlayerScripts”) end) wait(1)
(Sorry, still not familiar with all the Features of Devforum… )
Anyway, can someone tell me what I am doing wrong? How can I get the Module Script into PlayerScripts, without manually putting it inside the StarterCharacterScripts, because it will use a Loadstring, from a Product.
--lets assume the module script is currently a child of this server script
game.Players.PlayerAdded:Connect(function(player)
local mclone = script.ModuleScript:Clone()
mclone.Parent = player.PlayerScripts
end)
since am on phone there may be some minor errors with that.
Use ``` at the beginning and end to get the lua script format.
Using Player:WaitForChild("PlayerScripts") will absolutely do nothing other than yield the coroutine forever since the script you gave runs on server and PlayerScripts folder never replicates to server.
For example, the buyer will insert the Loadstring into the game, and it’s done, a mask will appear on all the players faces. I don’t want to make any hassle for the buyers, and I want to keep my product’s source code safe.