#How do i prevent this from happening?
1 messages · Page 1 of 1 (latest)
** You are now Level 1! **
Welder
local create = require(game:GetService("ReplicatedStorage"):WaitForChild("LoadLibrary"):WaitForChild("RbxUtility")).Create
function weldObject(x, y)
local cf = CFrame.new(x.Position)
local c0 = x.CFrame:toObjectSpace(cf)
local c1 = y.CFrame:toObjectSpace(cf)
create("Weld"){
Part0 = x,
Part1 = y,
C0 = c0,
C1 = c1,
Parent = x,
}
end
function combineParts(object)
if script.Parent:FindFirstChild("Handle") then
if object:IsA("BasePart") then
weldObject(script.Parent.Handle, object)
object.Anchored = false
else
table.foreach(object:GetChildren(), function(i, c)
combineParts(c)
end)
end
else
print("Handle is nil!")
end
end
combineParts(script.Parent)
script.Disabled = true
try ts
local tool = script.Parent
-- function to clear morph + helmets
local function clearMorphs(character)
if not character then return end
-- Remove torso morph parts (custom parts)
for _, part in ipairs(character:GetChildren()) do
if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
if part:FindFirstChild("WolfenchanMorphTag") then -- optional tag you add to morph parts
part:Destroy()
end
end
end
-- Remove accessories (like helmets)
for _, acc in ipairs(character:GetChildren()) do
if acc:IsA("Accessory") then
acc:Destroy()
end
end
end
tool.Unequipped:Connect(function()
local char = tool.Parent
if char and char:FindFirstChild("Humanoid") then
clearMorphs(char)
end
end)
-- if you also use "E" to unequip
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.E then
local char = tool.Parent
if char and char:FindFirstChild("Humanoid") then
clearMorphs(char)
end
end
end)
im new in scripting im not sure it will work
alr thanks
where do i put it
i mean when i click e on tool or unequip the tool accesory comes off
except for helmet
i tought it was problem with accesory so i switched it out but same was repeating for everything
so its tool problem
probably
kk
** You are now Level 2! **
script :
local tool = script.Parent
local morphFolder = tool:FindFirstChild("MorphParts") -- Folder with torso/armor parts
-- Tag used to identify morph parts
local TAG_NAME = "WolfenchanMorph"
-- Equip handler
tool.Equipped:Connect(function()
local char = tool.Parent
if not char or not morphFolder then return end
-- Clone morph parts into character
for _, part in ipairs(morphFolder:GetChildren()) do
if part:IsA("BasePart") or part:IsA("MeshPart") then
local clone = part:Clone()
clone.Name = TAG_NAME
clone.Anchored = false
clone.CanCollide = false
clone.Parent = char
-- Weld to torso
local hrp = char:FindFirstChild("HumanoidRootPart")
if hrp then
local weld = Instance.new("WeldConstraint")
weld.Part0 = hrp
weld.Part1 = clone
weld.Parent = hrp
end
end
end
print("Wolfenchan morph equipped!")
end)
-- Unequip handler
tool.Unequipped:Connect(function()
local char = tool.Parent
if not char then return end
-- Remove only morph parts we created (don’t touch accessories)
for _, obj in ipairs(char:GetChildren()) do
if obj:IsA("BasePart") or obj:IsA("MeshPart") then
if obj.Name == TAG_NAME then
obj:Destroy()
end
end
end
print("Wolfenchan morph removed!")
end)
alr
WolfenchanGun (Tool)
├─ Handle (Part)
├─ MorphParts (Folder) ← put your torso/armor parts inside here
└─ LocalScript (the script above)
do i make new script or put it in weld
kk
You should make a new script, not put it in your old weld script.
ho sorry..
it alr i'll try some other ways
wolfenchan is bit outdated system so yea not the least laggy one
?
whats the helmet even?