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

Where should I parent a script that is cloned locally?

Asked by
zomspi 541 Moderation Voter
4 years ago

I am trying to clone this script locally but I don't know how to.

First script

script.Parent.MouseButton1Click:connect(function()
    game.ReplicatedStorage.MoneyOnKill:Clone().Parent = game.Players.LocalPlayer.PlayerScripts
end)

Script being cloned

game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function() local cv = c.Humanoid:findFirstChild("creator") if cv 
then local k = cv.Value if k and k ~= p then k.leaderstats.Money.Value = 
k.leaderstats.Money.Value+2
end end end) end) end)


Thanks!

Answer this question