So I am trying to make an objective trigger. And I do it by touching a part, it fires a remote event and the local script handles the GUI and stuff. But my problem is that if I write FireAllClients() it works and every player will see it, which is fine but if I try to make it FireClient() I hear the objective sound but the GUI wont appear.
ServerScript in a part in workspace:
local rs = game:GetService("ReplicatedStorage")
local re = rs.RemoteEvents
local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild("Humanoid") and not debounce then
debounce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
re.ObjectiveEvent:FireAllClients(player, "Explore the daycare area.", 10)
task.wait(10)
debounce = false
end
end)
LocalScript in StarterGui:
local rs = game:GetService("ReplicatedStorage")
local re = rs.RemoteEvents
local GUI = script.Parent.ObjectiveGui
local Sounds = workspace.Sounds
local ObjectiveSound = Sounds.NewObjectiveSFX
re.ObjectiveEvent.OnClientEvent:Connect(function(player, Objective, ObjectiveTime)
GUI.Enabled = true
ObjectiveSound:Play()
GUI.ObjectiveText.Text = Objective
task.wait(ObjectiveTime)
GUI.Enabled = false
end)