-
What do you want to achieve? Basically, I want the server script to detect if I picked up a specific tool.
-
What is the issue? I can’t find a way to do so that works with the current script.
-
What solutions have you tried so far? I’ve already tried using :FindFirstChild, but it only works on LocalScripts. I also tried getting the character of the player and detecting if the tool is in the inventory but all I got were errors.
Script:
local DialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
local ObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ObjectiveEvent")
local ToggleDialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
local ToggleObjectiveEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleObjectiveEvent")
local function MainGame()
ToggleDialogueEvent:FireAllClients(true)
DialogueEvent:FireAllClients("Agent: Remember what you're here for.")
wait(3.1)
DialogueEvent:FireAllClients("Agent: Here are you're objectives.")
wait(2)
ToggleDialogueEvent:FireAllClients(false)
ToggleObjectiveEvent:FireAllClients(true)
ObjectiveEvent:FireAllClients("Investigate The Crash Site")
for i = 1, 0, -0.05 do
game.Workspace.Mark.Transparency = i
wait(0.01)
end
repeat wait() until game.Workspace.Triggers.DialogueTriggers:FindFirstChild("WhisperTrigger") == nil
game.Workspace.Mark.Transparency = 1
game.ReplicatedStorage.VoiceOvers.Whispers.Playing = true
wait(1)
game.ReplicatedStorage.Breathing.Playing = true
wait(4)
ToggleDialogueEvent:FireAllClients(true)
game.ReplicatedStorage.VoiceOvers:WaitForChild("VoiceOver2").Playing = true
DialogueEvent:FireAllClients("Agent: Is everything alright?")
wait(2.6)
ToggleDialogueEvent:FireAllClients(false)
game.Workspace.Phone.Handle.ProximityPrompt.Enabled = true
end
wait(4)
MainGame()
Any help will be appreciated!