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

Inserting Player Name into Text?

Asked by 9 years ago

This seems very basic, but I've been trying to learn lua better by doing this on my own.

01function oc(pl, dc)
02    if (dc.Name == "Yes") then
03        print("You own this tycoon!")
04        workspace.Tycoon.DoorHeader.UnownedPharmacy.Name ="'s Tycoon"
05    end
06    if (dc.Name =="No") then
07        print("You do not own this tycoon!")
08    end
09end
10script.Parent.DialogChoiceSelected:connect(oc)

more specifically, this line;

1workspace.Tycoon.DoorHeader.UnownedPharmacy.Name ="'s Tycoon"

After Name= , I ideally want it to chance the name to Carcanken's Tycoon for example, if I executed the dialog.

Thanks!

1 answer

Log in to vote
0
Answered by 9 years ago

If you have the players name then it would be

1workspace.Tycoon.DoorHeader.UnownedPharmacy.Name =player.Name.."'s Tycoon"
0
How would I go about identifying the players name? I understand how to identify variables but not entirely for this situation. carcanken 65 — 9y
0
Is the script local? User#5978 25 — 9y
0
In this situation pl would be the player, thumbs this question up :) User#5978 25 — 9y
Ad

Answer this question