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

How to get player from dialog?

Asked by
Zerio920 285 Moderation Voter
9 years ago

I'd like to get the player who clicked on the dialog initially. I was thinking of using DialogChoiceSelected, but it turns out that only activates when a choice of the dialog gets clicked on. I'd like to find some way to get the player when the player just clicks on the dialog initially, before choosing anything. Any ideas?

0
Sorry, there is none. You can only see if someone is chatting with the dialog, you can't find the player itself though. EzraNehemiah_TF2 3552 — 9y

1 answer

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

There's no way to get the player initially.. you're better off using a DialogChoice


The DialogChoiceSelected Event returns two things

  • The player that chose
  • The choice

Image

Just make a parameter for the player and use it(:


Code

script.Parent.DialogChoiceSelected:connect(function(plr,choice)
    print(plr.Name..' chose: '..choice.Name)
end
Ad

Answer this question