Hello. I have recently been working on some morphs and encountered this problem. I am new to scripting, and I do not know a lot of stuff about it. Could someone help me with this please? The morph won't come on when resetting.
local Group_ID = 6268298
local rankVal = script.Parent.MinimumRank
local TagColor = script.Parent.TagColor.Value
local Helmet = script.Parent.HELMET
local MorphPad = script.Parent.MorphButton
local debounce = false
MorphPad.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if plr.Team == game.Teams["The Drones Army"] then
local Rank = plr:GetRankInGroup(Group_ID)
if Rank >= rankVal.Value then
if debounce == false then
debounce = true
if plr.Character:FindFirstChild("HELMET") then
plr.Character.HELMET:Destroy()
end
local newHelmet = Helmet:Clone()
for _, item in pairs(newHelmet:GetChildren()) do
if item:IsA("Part") or item:IsA("MeshPart") or item:IsA("UnionOperation") then
item.Anchored = false
item.CanCollide = false
end
end
local weldScript = script.qPerfectionWeld:Clone()
weldScript.Parent = newHelmet
weldScript.Disabled = false
newHelmet.Parent = plr.Character
newHelmet:SetPrimaryPartCFrame(plr.Character.Head.CFrame)
local weld = Instance.new("WeldConstraint",newHelmet.PrimaryPart)
weld.Part0 = newHelmet.PrimaryPart
weld.Part1 = plr.Character.Head
plr.Character.Head.Transparency = 1
for _,item in pairs(plr.Character.Head:GetChildren()) do
if item:IsA("Decal") then
item:Destroy()
end
end
for _,item in pairs(plr.Character:GetChildren()) do
if item:IsA("Accessory") then
item:Destroy()
end
end
plr.Character.Head.NameUI.Team.TextColor3 = TagColor
plr.Character.Head.NameUI.Team.Text = plr:GetRoleInGroup(Group_ID)
wait(0.5)
debounce = false
end
end
end
end
end
end)
