Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Using name of player who is talking to dialog?

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

✓ Accepted answer

Change player.Name to pl.Name in line 4

This discussion is preserved as it was. New answers, comments, and votes are closed.