The helmet is supposed to become transparent when retracted (which I’ve done succesfully) and nontransparent again when protracted which I can’t get to work.
This is the block of the script that handles the transparency:
local function CloseHelmet()
if HelmetOpened == true then
HelmetOpened = false
local Time = 0.5
local CloseGoal = {}
CloseGoal.Value = PivotCentre
local Tween = TweenService:Create(WeldPivotCentreValue,Info,CloseGoal)
local NonTransparentTween = TweenService:Create(Helmet,TweenInfo.new(Time),{Transparency = 0})
Tween:Play()
end
end
local function OpenHelmet()
if HelmetOpened == false then
HelmetOpened = true
local Time = 0.5
local OpenGoal = {}
OpenGoal.Value = PivotCentre * CFrame.Angles(math.deg(80),0,0)
local Tween = TweenService:Create(WeldPivotCentreValue,Info,OpenGoal)
local TransparentTween = TweenService:Create(Helmet,TweenInfo.new(Time),{Transparency = 1})
Tween:Play()
TransparentTween:Play()
end
end
while true do
wait(10)
CloseHelmet()
wait(2)
OpenHelmet()
end
I tried to reverse the steps I did to make the part transparent, why isn’t it working?
In your loop can you print(HelmetOpened) and can you also add a print in the OpenHelmet function right after Tween:Play(). Just print something random after you play the tween just so we can see if its actually running.
Make sure you have output open and tell us the results.
The results came out true and “Hello” which I printed after Tween:Play(), so it does work. It repeats in the loop too so it’s likely just an issue with the transparency stuff.
No, I mean the bool print(HelmetOpened) that you used in your if statements if HelmetOpened == false then. I want to see if its actually turning false since you said it was only true.
I noticed that you forgot to play your NonTransparentTween in the CloseHelmet() function. I think thats your issue since you defined the tween but haven’t actually played it!