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

Using name of player who is talking to dialog?

Asked by 8 years ago
function oc(pl, dc)
    if (dc.Name == "Yes") then
        print("You own this tycoon!")
        workspace.Tycoon.DoorHeader.UnownedPharmacy.Name =player.Name.."'s Tycoon"
    end
    if (dc.Name =="No") then
        print("You do not own this tycoon!")
    end
end
script.Parent.DialogChoiceSelected:connect(oc)

In the 4th line, how would I identify a global variable, as the player who is enacting the specific dialog, so it would print "Carcanken's Tycoon" if I was using the dialog.

Thanks!

1 answer

Log in to vote
0
Answered by 8 years ago

Change player.Name to pl.Name in line 4

Ad

Answer this question