I want to make an r6 to r15 plugin, and I need to replace text in a string.
The issue is it is spamming replaced text, giving me a string too long error.
I have looked into many examples on how to use string.gsub, but none of them work
Here is my code
if object:IsA("Script") or object:IsA("LocalScript") or object:IsA("ModuleScript") then local ns = string.gsub(object.Source,"Torso", "HumanoidRootPart") print("ran1") ns = string.gsub(ns,"Left Arm", "LeftHand") print("ran2") ns = string.gsub(ns,"Right Arm", "RightHand") print("ran3") ns = string.gsub(ns,"Left Leg", "LeftFoot") print("ran4") ns = string.gsub(ns,"Right Leg", "RightFoot") print("ran5") ns = string.gsub(ns,'[Neck]', ".Neck") print(ns) print("ran6") ns = string.gsub(ns,".Neck", ".Parent.Head.Neck") print("ran7") ns = string.gsub(ns,'["Right Shoulder"]', ".Parent.RightUpperArm.RightShoulder") print("ran8") ns = string.gsub(ns,'["Left Shoulder"]', ".Parent.LeftUpperArm.LeftShoulder") print("ran9") ns = string.gsub(ns,'["Right Hip"]', ".Parent.RightUpperLeg.RightHip") print(#ns) ns = string.gsub(ns,'["Left Hip"]', ".Parent.LeftUpperLeg.LeftHip") print("ran11") print(#ns) local obj = object:Clone() obj.Source = ns obj.Name = object.Name .. "(R15)" obj.Parent = object.Parent print("ran12") end