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

Why wont my script clone the folder into the leaderstats folder?

Asked by 4 years ago
local me = script.Parent.Z1
local EXP = script.Parent.EXP
local Gold = script.Parent.Gold
local plr = game.Players.LocalPlayer
local lstats = plr:WaitForChild("leaderstats")

game.Players.PlayerAdded:Connect(function(Player)
    local ree = me:Clone()
    ree.Parent = lstats
end)

My script is supposed to clone a folder with scripts inside of it, and it wont work for some reason. I check inside of the player, and it doesn't show, or even run the scripts. If you know what's wrong, please tell me! Thanks.

2 answers

Log in to vote
0
Answered by 4 years ago

just extract the folder you have into StarterPlayer\StarterPlayersScripts

0
I tried that, it didnt work. Whats extracting, though? Because i want it cloned for everyone, is it the same thing? Trisodin529 89 — 4y
0
Extracting is just a fancy way of saying, "Put" or "Place", for example, extract the folder into StarterPlayer, he's saying put the folder into starter player. killerbrenden 1537 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Put your ServerScript that's handling the cloning into ServerScriptService, and then put the Folder inside of ReplicatedStorage and call it from there.

ServerScript

game.Players.PlayerAdded:Connect(function(player)
    local me = game:GetService("ReplicatedStorage"):WaitForChild("Z1"):Clone()
    local EXP = game:GetService("ReplicatedStorage"):WaitForChild("EXP"):Clone()
    local Gold = game:GetService("ReplicatedStorage"):WaitForChild("Gold"):Clone()

    me.Parent = player:WaitForChild("leaderstats")
    EXP.Parent= player:WaitForChild("leaderstats")
    Gold.Parent = player:WaitForChild("leaderstats")
end)

All you have to do is put a Folder inside of ReplicatedStorage with all the scripts, and then put a ServerScript inside of ServerScriptService and write the code above.

Answer this question