Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --DoorScript
- local Door = script.Parent
- local TweenService = game:GetService("TweenService")
- local Info = TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
- local DoorOpenPosition = script.Parent.Parent.OpenPosition
- local DoorClosePosition = script.Parent.Parent.ClosedPosition
- local DoorOpenTween = TweenService:Create(Door,Info,{CFrame = DoorOpenPosition.CFrame})
- local DoorClosedTween = TweenService:Create(Door,Info,{CFrame = DoorClosePosition.CFrame})
- script.Parent.Touched:Connect(function(hit)
- if hit and hit.Parent.Name == "OfficeKey" then
- DoorOpenTween:Play()
- hit.Parent:Destroy()
- end
- end)
- --FoundOfficeTrigger
- script.Parent.Touched:Connect(function(hit)
- if hit and hit.Parent:FindFirstChild("Humanoid") then
- script.Parent:Destroy()
- end
- end)
- --MainGameScriptUpdated
- --Updated Script
- local DialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
- local ObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ObjectivEvent")
- local TransitionEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("TransitionEvent")
- local ToggleDialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
- local ToggelObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleObjectiveEvent")
- local function MainGame()
- ToggleDialogueEvent:FireAllClients(true)
- DialogueEvent:FireAllClients("I Need To Find The MainRoom")--What the dialogue says
- wait(4)
- ToggleDialogueEvent:FireAllClients(false)
- ToggelObjectiveEvent:FireAllClients(true)
- ObjectiveEvent:FireAllClients("Find The Main Room")--What the objective is
- repeat wait() until game.Workspace.Triggers.DialogueTriggers:FindFirstChild("FoundOfficeTrigger") == nil
- ToggleDialogueEvent:FireAllClients(true)
- ToggelObjectiveEvent:FireAllClients(false)
- DialogueEvent:FireAllClients("Darn I Need A key Better Keep Looking Around")
- wait(4)
- ToggleDialogueEvent:FireAllClients(false)
- ToggelObjectiveEvent:FireAllClients(true)
- ObjectiveEvent:FireAllClients("Find The Key")
- TransitionEvent:FireAllClients()
- wait(2)
- end
- wait(2)
- MainGame()
- --ToolScript
- local tool = script.Parent.Parent
- local function click(player)
- tool.Parent = game.Workspace[player.Name]
- end
- script.Parent.ClickDetector.MouseClick:Connect(click)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement