[Question] Player Follow


#1

I’m currently working on a custom game mode, however one requirement is the ability to force a player to follow another player with a command. Has anyone done something similar? Can anyone tell me if there are currently any client commands to force a player to follow another player?

Thanks!


#2

You can freeze a player if they’re not within X meters of another player. Thus forcing them to follow.


#3

That could potentially work. I was looking more for a way to force a player to stack on the player and wherever a player goes they go. And disallow them to move. Basically as if you were escorting someone. Care to provide a quick example of a your method being used @Apocalyptikz?


#4

The

TaskFollowToOffsetOfEntity(ped, entity, offsetX, offsetY, offsetZ, movementSpeed, p6, stoppingRange, p8)

or

TaskGoToEntity(entity, target, duration, distance, speed, p5, p6)

function might be helpful.

You can look here for all the client-sided functions and what the args mean.


#5

Thanks guys. Would either of you know how to send a client native to all players within a specific radius of a player? This is the only way I can think to get the indicator lights to work network-side. Unless there is another way for indicator lights?


#6

Just listen for it, then broadcast it to every client via TriggerClientEvent("SomeEvent", -1, ...) on the server-side


#7

Sweet. Appreciate it!

Scott