So I have this simple script that when OnTouched duplicates the scripts from within my model into your Character, pretty simple. The problem I am having concerns the script duplication from within your character itself. It tends to cause lag as more than one of each script can be found from within your Character, which is a big problem on my part. I get this isn't a request site but is there any possible way of stopping my scripts from stacking without completely disabling the OnTouched script or removing the base part? Help would be amazing on my part! :)
(I know the answer is obvious but I just cant seem to see it)
Here's the script I am having issues with:
Part = script.Parent
debounce = false
function onTouch(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if (human ~= nil) then
wait(1)
Part["MG"]:clone().Parent = hit.Parent
Part["SSE"]:clone().Parent = hit.Parent
Part["SSQ"]:clone().Parent = hit.Parent
Part["AA"]:clone().Parent = hit.Parent
Part["R"]:clone().Parent = hit.Parent
Part["RR"]:clone().Parent = hit.Parent
end
end
script.Parent.Touched:connect(onTouch)
(Don't mind the script abbreviations, I know I'm messy with them)
