Trying to make an objective system however whenever I want to fire the event to change the text, there’s no errors but whenever I get to the firing part it doesn’t do anything.
Obj1 = ObjectiveSystem.Create("Make the call for help!")
Remotes.Objectives:FireAllClients(Obj1.ObjectiveName)
Local
local Objectives = game.Workspace.GameObjects.Objectives
local remote = game.ReplicatedStorage.Remotes:WaitForChild("Objectives")
task.wait(1)
remote.OnClientEvent:Connect(function(ObjectiveName)
print(ObjectiveName)
script.Parent.ObjectiveFrame.Objective.Text = "Complete"..ObjectiveName
end)
The task.wait is suspicious to me, if your .OnClinetEvent isn’t connected on time it won’t recieve events. Does your remote fire near the start of the game?
Then you certainly need to remove the task.wait(1). If possible remove the :WaitForChild for :FindFirstChild, any remote event that should be instantly listening must have no yeilding functions before it’s connection.
It takes quite a while for local scripts to initialize before server scripts, by average, after two or three seconds after loading in they’ll be initialized right after.
Even when true the local scripts can accept any events fired from a OnPlayerAdded connection. So long as local script do not have yielding functions like ask.wait or :WaitForChild before connection.