Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesnt its transparency change?

Asked by 6 years ago
Edited 6 years ago

elseif mode == 2 then --Reality local soundeffect = game.ReplicatedStorage.LandSummon:Clone() soundeffect.Parent = character.UpperTorso soundeffect:Play() local summon = game.ReplicatedStorage:FindFirstChild("Dark Land"):Clone() local summonchildren = summon:GetChildren() summonchildren.Transparency = 1 summon.PrimaryPart = summon.Center summon.Parent = character.RightFoot summon:SetPrimaryPartCFrame(summon:GetPrimaryPartCFrame() * CFrame.new(character.RightFoot.Position))

for i = 1,10 do wait(0.05) summonchildren.Transparency = summonchildren.Transparency - 0.1 end

game:GetService("Debris"):AddItem(summon,30

its transparency wont change. 'Dark Land' is a model.

1
You didn't put the whole code into the code block lol hellmatic 1523 — 6y
1
only one line of code? awesomeipod 607 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You’re trying to set the transparency of a table. :P

:GetChildren() returns a table, so you’ll have to use a for loop to actually get all the parts.

Here’s an example of how to use it :

local model = script.Parent -- Script is in model

for i,v in pairs(model:GetChildren()) do -- “i” is the number of items in model. “v” are the items thenselves
    if v:IsA('BasePart') then -- Checks if object is a part
        v.Transparency = 1
    end
end

Hoped this helped!

Also please put your code in a code block next time.

0
lol DeceptiveCaster 3761 — 6y
Ad

Answer this question