Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Distributing stuff wont work?

script.Parent.Touched:connect(function(part)
if part.Parent:FindFirstChild("Humanoid") ~= nil then
script.LocalScriptz:clone().Parent = game.Players:FindFirstChild(part.Parent.Name).PlayerGui
end
end)

It copies more than and lags the game. I know it's stupid and I can figure it out... But still... Help!

1 answer

✓ Accepted answer

:clone()

Use :Clone() instead, also its because you are not debouncing.

You need to make a variable called debounce at the very top of the script Make it false Then, Make an if statement, that only carries on if it's false After that, redefine it true. It should look like this:

debounce = false
script.Parent.Touched:connect(function(part)
if debounce == false then
debounce = true
if part.Parent:FindFirstChild("Humanoid") ~= nil then
local cloned = script.LocalScriptz:Clone()
cloned.Parent = Game.Players:FindFirstChild(part.Parent.Name).PlayerGui
end
end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.