1 | ----- Imports |
2 | local Sounds = game:GetService("Workspace"):WaitForChild("Sounds") |
3 | local StarterGUI = game:GetService("ServerStorage"):WaitForChild("StarterScreen") |
4 | local Values = game:GetService("ReplicatedStorage"):WaitForChild("Values") |
5 | local Dialog = Values:WaitForChild("Dialog") |
6 | local Objective = Values:WaitForChild("Objective") |
7 | local Point1 = game.Workspace:WaitForChild("Point1") |
8 | local Value = game:GetService("ReplicatedStorage"):WaitForChild("Values"):WaitForChild("FixedTables") |
9 | local Point2 = game.Workspace:WaitForChild("Point2") |
10 | local module = require(game.ServerScriptService.Functions) |
11 | local Shine = game:GetService("ReplicatedStorage"):WaitForChild("Values"):WaitForChild("Shine") |
12 | local canStart = game:GetService("ReplicatedStorage"):WaitForChild("Values"):WaitForChild("CanStart") |
13 | |
14 | |
15 | |
16 | --- Starter Of Game. |
17 | |
18 | game.Players.PlayerAdded:Connect(function(Player) |
19 | Player.CharacterAppearanceLoaded:Connect(function() |
20 | local Folder = Instance.new("Folder") |
21 | Folder.Name = "Inventory" |
22 | Folder.Parent = Player |
23 | --- here |
24 | canStart.Changed:Connect(function(Value) |
25 | if Value == true then |
26 | StarterGUI:Clone().Parent = Player.PlayerGui |
27 | Sounds.ChapterStart:Play() |
28 | task.wait(5) |
29 | Player.PlayerGui:WaitForChild("StarterScreen"):Destroy() |
30 | Sounds.DIA_Being:Play() |
31 | module.Dialog("Alright, Joey. I'm here. Let's see if we can find what you wanted me to see.", 6) |
32 | module.Object("Discover Joey's secret.", "Tip: Locate the Ink Machine.") |
33 | end |
34 | end) |
35 | end) |
36 | end) |
37 | |
38 | --- Objects |
39 | |
40 | Point1.Touched:Connect(function() |
41 | game.Workspace:WaitForChild("PointSammy").CanTouch = true |
42 | Point1:Destroy() |
43 | local Sound = Sounds:WaitForChild("DIA_InkMachineHuh") |
44 | Sound:Play() |
45 | module.Dialog("So this is the ink machine, huh? Wonder how you turn it on.", 5) |
46 | module.Object("Turn on the ink machine.", "Tip: Locate the Main Power room.") |
47 | game.Workspace:WaitForChild("ThePlankOMG"):Destroy() |
48 | Point2.CanTouch = true |
49 | Point1:Destroy() |
50 | end) |
51 | |
52 | Point2.Touched:Connect(function() |
53 | Point2:Destroy() |
54 | local Sound = Sounds:WaitForChild("DIA_AlrightHowToWork") |
55 | Sound:Play() |
56 | module.Dialog("Alright, how do I get this to work?", 3) |
57 | module.Object("Fix the ink machine.", "Tip: Find the needed items.") |
58 | Values:WaitForChild("Reached1").Value = true |
59 | Values:WaitForChild("Shine").Value = true |
60 | for i, v in pairs(game.Workspace.BendyWhat:GetChildren()) do |
61 | v.Transparency = true |
62 | end |
63 | game.Workspace.CutoutDialog.CanTouch = true |
64 | game.Workspace:WaitForChild("PlankLol"):Destroy() |
65 | end) |
66 | |
67 | |
68 | Value.Changed:Connect(function() |
69 | if Value.Value == 6 then |
70 | Sounds.DIA_Pressure:Play() |
71 | Values.Reached1.Value = false |
72 | Values.Pressure.Value = true |
73 | game.Workspace.BendyWhat:Destroy() |
74 | task.wait(0.5) |
75 | module.Dialog("Ok! That is all of them! I just need to get the ink flowing somehow. Should be a switch around here somewhere. Then I can start up the main power.", 8) |
76 | module.Object("Restore Ink Pressure", "Find the Ink Pressure room.") |
77 | game.Workspace.JumpscareCutoutTouch.CanTouch = true |
78 | end |
79 | end) |
80 | |
81 | Shine.Changed:Connect(function() |
82 | if Shine.Value == true then |
83 | for i, v in pairs(game.Workspace:WaitForChild("ToolsOutside"):GetChildren()) do |
84 | game:GetService("ServerStorage"):WaitForChild("Highlight"):Clone().Parent = v |
85 | end |
86 | end |
87 | end) |