Blast door script works in studio but doesn't work while playing in game?
Asked by
5 years ago Edited 5 years ago
Greetings,
So I've been making a tweening script for a pressurized blast door which first depressurizes, then it opens. The thing is, it seems to work while I'm testing in studio, but when I join in-game, it doesn't even print anything. Is there a reason why it does that?
01 | local TweenService = game:GetService( "TweenService" ) |
03 | local TweeningInfo = TweenInfo.new( |
05 | Enum.EasingStyle.Linear, |
06 | Enum.EasingDirection.InOut, |
14 | local Model = script.Parent.Parent |
15 | local Up = Model:WaitForChild( "PressurisedDoorUp" ) |
16 | local Down = Model:WaitForChild( "PressurisedDoorDown" ) |
17 | local Left = Model:WaitForChild( "PressurisedDoorDecouplersLeft" ) |
18 | local Right = Model:WaitForChild( "PressurisedDoorDecouplersRight" ) |
20 | local UpOpen = { CFrame = CFrame.new( 51.903 , 20.667 ,- 0.961 ) * CFrame.fromEulerAnglesYXZ(math.rad(- 90 ),math.rad( 0 ),math.rad( 0 )) } |
21 | local DownOpen = { CFrame = CFrame.new( 51.903 ,- 2.483 ,- 0.961 ) * CFrame.fromEulerAnglesYXZ(math.rad( 90 ),math.rad( 0 ),math.rad( 0 )) } |
22 | local LeftOpen = { CFrame = CFrame.new( 51.928 , 8.334 ,- 20.036 ) * CFrame.fromEulerAnglesYXZ(math.rad(- 17.5 ),math.rad( 180 ),math.rad( 0 )) } |
23 | local RightOpen = { CFrame = CFrame.new( 51.928 , 8.334 , 18.064 ) * CFrame.fromEulerAnglesYXZ(math.rad(- 17.5 ),math.rad( 0 ),math.rad( 0 )) } |
25 | local UpClosed = { CFrame = CFrame.new( 51.903 , 13.042 ,- 0.961 ) * CFrame.fromEulerAnglesYXZ(math.rad(- 90 ),math.rad( 0 ),math.rad( 0 )) } |
26 | local DownClosed = { CFrame = CFrame.new( 51.903 , 5.167 ,- 0.961 ) *CFrame.fromEulerAnglesYXZ(math.rad( 90 ),math.rad( 0 ),math.rad( 0 )) } |
27 | local LeftClosed = { CFrame = CFrame.new( 51.928 , 8.334 ,- 14.336 ) * CFrame.fromEulerAnglesYXZ(math.rad(- 17.5 ),math.rad( 180 ),math.rad( 0 )) } |
28 | local RightClosed = { CFrame = CFrame.new( 51.928 , 8.334 , 12.439 ) * CFrame.fromEulerAnglesYXZ(math.rad(- 17.5 ),math.rad( 0 ),math.rad( 0 )) } |
30 | local TweenUpClosed = TweenService:Create(Up,TweeningInfo,UpClosed) |
31 | local TweenDownClosed = TweenService:Create(Down,TweeningInfo,DownClosed) |
32 | local TweenLeftClosed = TweenService:Create(Left,TweeningInfo,LeftClosed) |
33 | local TweenRightClosed = TweenService:Create(Right,TweeningInfo,RightClosed) |
35 | local TweenUpOpen = TweenService:Create(Up,TweeningInfo,UpOpen) |
36 | local TweenDownOpen = TweenService:Create(Down,TweeningInfo,DownOpen) |
37 | local TweenLeftOpen = TweenService:Create(Left,TweeningInfo,LeftOpen) |
38 | local TweenRightOpen = TweenService:Create(Right,TweeningInfo,RightOpen) |
40 | script.Parent.Touched:Connect( function (Hit) |
44 | if Hit.Parent:FindFirstChild( "Humanoid" ) then |
47 | Model.Depressurizing.Slide:Play() |
50 | Model.Depressurizing.Slide:Stop() |
52 | Model.Depressurizing.Slide:Play() |
55 | Model.Depressurizing.Slide:Stop() |
57 | Model.Depressurizing.Slide:Play() |
59 | TweenDownClosed:Play() |
60 | Model.Depressurizing.Slide:Stop() |
62 | Model.Depressurizing.Slide:Play() |
63 | TweenLeftClosed:Play() |
64 | TweenRightClosed:Play() |
65 | Model.Depressurizing.Slide:Stop() |
71 | function Depressurizing() |
72 | local Depressure = Model:WaitForChild( "Depressurizing" ) |
73 | for i,v in pairs (Depressure:GetChildren()) do |
74 | if v.Name = = "ParticleEmitter" then |
78 | Depressure.Pressure:Play() |
80 | for i,v in pairs (Depressure:GetChildren()) do |
81 | if v.Name = = "ParticleEmitter" then |
85 | Depressure.Pressure:Stop() |
This is the door's hierarchy: Hierarchy