So I made a melee script that lets me add more melees in the future but the transparency is invisible, I don’t know why I have a similar script and it works just fine but this one is broken?
It doesn’t get the GetPropertyChangedSignal()
script:
meleeevt.OnClientEvent:Connect(function(Name)
coroutine.wrap(meleecooldown)()
local meleemodel = nil
if Name ~= "None" then
for i, v in pairs(char["Right Arm"]:GetChildren()) do
if v.Name == Name then
meleemodel = v
end
end
if meleemodel then
for i, v in pairs(meleemodel:GetDescendants()) do
if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
print(1)
v.LocalTransparencyModifier = v.Transparency
end)
end
end
end
end
end
The similar script in question (both are localscripts):
DrinkEvt.OnClientEvent:Connect(function(drink, perk)
local perkmodel = nil
for i, v in pairs(char["Right Arm"]:GetChildren()) do
if v.Name == drink then
perkmodel = v
end
if perkmodel then
for i, v in pairs(perkmodel:GetDescendants()) do
if v:IsA("Part") or v:IsA("MeshPart") then
v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
v.LocalTransparencyModifier = v.Transparency
end)
end
end
end
end
end)