Log in to vote
0

How would you clone a local script to a backpack?

Asked by 7 years ago

I'm using something like this: local debounce = false

function OnTouch(hit) if hit.Parent == nil then return end a = hit.Parent:FindFirstChild("Humanoid") if a ~= nil then

end end script.Parent.Touched:connect(OnTouch)

1 answer

Log in to vote
0
Answered by
Cizox 80
7 years ago
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local lScript = game.ServerStorage:findFirstChild('LocalScript'):Clone()
lScript.Parent = player.Backpack
end
end)
0
could you get it to clone only once? BloxAdventure 0 — 7y
0
Add a debounce to it. Cizox 80 — 7y
Ad

Answer this question