Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is the best way to detect if a player from a certain team is close to a certain model or part? [closed]

Asked by 5 years ago

What I'm trying to do is edit the C4 model I made to where if a player from a certain team is close enough to it, then a Gui will appear on that player's screen telling him to hold E to defuse. I want it to be able to detect if the player is holding E. If the player has held E for about six seconds then the C4 is removed.

I'm wondering if it is best to have a script inside the players on that team to detect if the player is close enough to the bomb, and then proceed with what I mentioned earlier. Or is it best to have the script in the C4 detect if any player from that team is close enough, and if there is any close enough then enable those players to defuse it.

How would I be able to check if any player from a team is close enough to that model? And once it has found a player close enough, how would I check if the player is holding E? Perhaps I would need a script in both the C4 and the player to do this, I just need to know what would be the best method in doing this, and how would I write the part that finds any players close enough to defuse?

0
magnitude DeceptiveCaster 3761 — 5y
0
Also, don't ask opinion-based questions. DeceptiveCaster 3761 — 5y

Closed as Primarily Opinion-Based by DeceptiveCaster and User#24403

This question has been closed because it is a discussion about a topic focused on diverse opinions, which isn't a good fit for our Q&A format.

Why was this question closed?