Hello I want To Run Something as soon as a player joins but i need to wait a bit so the function connects, i can try wait(1) but it may take more than 1 sec to connect is there a way to wait
thank you
Hello I want To Run Something as soon as a player joins but i need to wait a bit so the function connects, i can try wait(1) but it may take more than 1 sec to connect is there a way to wait
thank you
There is a method called Wait which stops the thread from continuing until the signal fires
Event:Wait() -- replace this with the function you wanna wait for
I got an error
Wait is not a valid member of RemoteEvent "ReplicatedStorage.CameraFocus"
Mb, that has to be an RBXScriptSignal. (something like .Touched)
so as an example:
part.Touched:Wait()
You are attempting to call the Wait()
on an instance, it is only exposed by RBXScriptSignal
s so for a RemoteEvent that would be RemoteEvent.OnServerEvent
or RemoteEvent.OnClientEvent
.
There is a built in function that let’s you know when a player has joined the game:
ReplicatedStorage.CameraFocus.OnServerEvent:Wait()
as @NinjaFurfante07 mentioned