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

How to make a tycoon owner's name appear on a text label?

So I'm currently making a tycoon (I'm a noob at it but I know scripting basics and modeling) and I want to make a billboard on each person's tycoon that has their name and maybe their avatar. I'm not sure if I should be using a billboard gui for this or wether or not my script is on the right track, but I would just like somebody to show me how to do this.

script.Parent.Text=script.Parent.Parent.Parent.Parent.Parent.Parent.Owner.Value.."'s Tycoon"

script.Parent.Parent.Parent.Parent.Parent.Parent.Owner.changed:connect(function(GetFullName)
	script.Parent.Name = GetFullName.."'s Tycoon"
end)

I'm not completely sure if anything past the third line is correct or would work, but if someone could get back to me, that would be great.

1 comment

1 answer

✓ Accepted answer

Make the item in a model, and the item be called "Head". Then place a humanoid inside the model, and a text will appear on top of the Head item, with the name of the model. You could keep that script in the model to rename it. Another way is to use a SurfaceGui and directly alter the text, which I would recommend. It really depends on what you're aiming for. Also, a few things to keep in mind: Changed and Connect should both be capitalized. Your current code won't work correctly because:

local Owner = script.Parent.Parent.Parent.Parent.Parent.Parent.Owner
script.Parent.Text= Owner.Value.."'s Tycoon"

Owner.Changed:Connect(function(GetFullName)
	-- GetFullName is the name of the property which is changed, not the new string value
    script.Parent.Name = (Owner.Value.."'s Tycoon")
end)

3 comments

0

Wait, so I changed it to a SurfaceGui and put everything in there, but I don't know what you mean by directly altering the text. Could you tell me how to do that?

0

I forgot to add that it still won't work and I directly copied and pasted the script you gave me into the TextLabel for the SurfaceGui. (And I apologize for being so bad at scripting)

0

I'll make you a script if you really need it.

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