Do not work still
hmmm, are there any errors? Also can you try to check if the transparency of the gifts is set to 1?
Didnât saw any errors, gift transparency is 0, value is false, so gift transparency become 1.
Still donât know how to do. Sorry for bumping
Is the transparency of that particular gift set to 1 in the last screenshot you sent?
The reason @BriefTaste reply didnât work is due to typos(they mispelled GiftNs
with GiftN
). Also itâs better to run the code each time the value changes rather than looping every 0.5 seconds:
local Player = game.Players.LocalPlayer
local ChristmasStartedValue = Player.PlayerGui.ChristmasGUI.Frame.EventStarted
local GiftPack = game.Workspace.Gifts
local GiftN = {
GiftPack.Gift1, GiftPack.Gift2, GiftPack.Gift3,
GiftPack.Gift4, GiftPack.Gift5, GiftPack.Gift6,
GiftPack.Gift7, GiftPack.Gift8, GiftPack.Gift9,
GiftPack.Gift10, GiftPack.Gift11, GiftPack.Gift12,
GiftPack.Gift13, GiftPack.Gift14, GiftPack.Gift15,
GiftPack.Gift16,
}
function ValueChanged(value)
local condition = (value == "True")
for _, Gift in pairs(GiftN) do
Gift.Transparency = (condition and 0) or 1
Gift.CanCollide = condition
end
task.wait(0.5)
end
ValueChanged(ChristmasStartedValue.Value)
ChristmasStartedValue.Changed:Connect(ValueChanged)
PS:
Also instead of storing all the gifts in an array, you can do:
--GiftPack:GetChildren() will return an array which contains all the children(assuming all of them are gifts)
for _, Gift in pairs(GiftPack:GetChildren()) do
make a function that does that u can input the property the array and value of it and yea thats all
In this case, a for loop
is your solution.
Okay nvm, this doesnât works. When value become true, gift still invisible(transparency 1 still)