Hello. I hope this should be a quick fix. Here is my localscript:
local LegionFrame = script.Parent.Parent.Legions
local UniformFrame = script.Parent.Parent.Uniforms
local MorphsDir = game.ReplicatedStorage.Morphs
local Libs =game.ReplicatedStorage.Libs
local RemoteEvent = game.ReplicatedStorage.Youneedthis
local Player = game.Players.LocalPlayer
for i,v3 in pairs(MorphsDir:GetChildren()) do
local Button = Instance.new("TextButton")
Button.Size = UDim2.new(1,0,0,50)
Button.BackgroundTransparency = 1
Button.Font = "SciFi"
Button.TextSize = 30
Button.TextXAlignment = "Left"
Button.TextColor3 = Color3.fromRGB(255,255,255)
Button.Text = v3.name
Button.Parent = LegionFrame
Button.MouseButton1Click:Connect(function()
for i,v2 in pairs(UniformFrame:GetChildren()) do
if v2.ClassName == "TextButton" then
v2:Destroy()
end
end
for i,Morph in pairs(v3:GetChildren()) do
local Button2 = Instance.new("TextButton")
Button2.Size = UDim2.new(1,0,0,50)
Button2.BackgroundTransparency = 1
Button2.Font = "SciFi"
Button2.TextSize = 30
Button2.TextXAlignment = "Left"
Button2.TextColor3 = Color3.fromRGB(255,255,255)
Button2.Text = Morph.Name
Button2.Parent = UniformFrame
Button2.MouseButton1Click:connect (function()
print(Button2.Text)
RemoteEvent:FireServer(Morph, Button)
end)
end
end)
end
Here is the script:
-- This is just a part of the script the other things are unimportant.
game.ReplicatedStorage.Youneedthis.OnServerEvent:Connect(function(Player, Morph, Button)
coroutine.resume(coroutine.create(function()
if Player.Character:FindFirstChild(Morph.Name) == nil then
wait(0.1)
local FindMorph = game.ReplicatedStorage.Morphs:FindFirstChild(Morph.Name)
local Cloned = FindMorph:FindFirstChild(Button.Name):Clone() -- Error here
Cloned.Parent = Player.Character
for i, v in pairs(Cloned:GetChildren()) do
coroutine.resume(coroutine.create(function()
if v:IsA("BasePart") then
if v.Name ~= "Middle" then
local w = Instance.new("Weld")
w.Part0 = Cloned["Middle"]
w.Part1 = v
w.C0 = w.Part0.CFrame:inverse() * CFrame.new(w.Part1.Position)
w.C1 = w.Part1.CFrame:inverse() * CFrame.new(w.Part1.Position)
w.Parent = w.Part0
else
coroutine.resume(coroutine.create(function()
wait(0.1)
local w = Instance.new("Weld", Player.Character["Torso"])
w.Part0 = Player.Character["Torso"]
w.Part1 = v
w.C0 = CFrame.new(0, 0, 0)
end))
end
end
end))
end

3 comments
What line?
I made a comment on the line that the error is on its in the normal script.
The problem is you're passing a TextButton you created in a LocalScript, in FireServer. The server cannot see stuff you create from LocalScripts so it sees nil