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

How do I get my sign to change text to something with the players name?

Im trying to get a sign to change text to: "This tycoon is owned by example1234!" so people can know who owns a tycoon. The changing the text is on line 6, the error is "Attempt to index nil with "Name"

tyen1n is a model with a block called text

script.Parent.Touched:Connect(function(hit)
	if script.Parent:GetTouchingParts(hit.Parent.HumanoidRootPart) then
		script.Parent.CanCollide = false
		script.Parent.BrickColor = BrickColor.new("Really red")
		game.Workspace.ty1ba.Size = Vector3.new(420.69, 0.8 , 420.69)
		script.Parent.Parent.tyen1n.Text.SurfaceGui.TextLabel.Text = "This tycoon is owned by " .. game.Players.LocalPlayer.Name
		game.Workspace.tyc1.start.CanCollide = true
		game.Workspace.tyc1.start.SurfaceGui.Enabled = true
		game.Workspace.tyc1.start.Script.Disabled = false
	end
end)

2 comments

0

Is this in a local script or server script

0

Is this a script or local script?

2 answers

If you are doing that in a regular script/server script you cant use game.Players.LocalPlayer

consider putting a "()" in the changing text line

3 comments

0

i mean do this in line 6:       script.Parent.Parent.tyen1n.Text.SurfaceGui.TextLabel.Text = ("This tycoon is owned by " .. game.Players.LocalPlayer.Name)

0

That will not work.

0

Bruh

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