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

TextLabel text doesnt appear?

Its supossed to create a new textlabel (Wich it does) but you cant see the text of it? I can indeed see it in properties. Can someone help?

function onClicked(Player)
	local textlabel = Instance.new("TextLabel")
	textlabel.Name = 'Item1'
	textlabel.Parent =  game.StarterGui.OpenCloseGUI.Frame
	textlabel.Text = "Cane"
	textlabel.BackgroundTransparency = 1
	textlabel.TextSize = 15
	textlabel.Font = ("Cartoon")
	textlabel.ZIndex = 2
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)

2 comments

0

Each player has a GUI folder called the PlayerGui. That is what they see. The StarterGui is what you see in Studio, and what is replicated (copied) to all players in the server upon joining or respawning, so you would change it in the PlayerGui. If this is a LocalScript, use script.Parent.Parent etc..

2 answers

the end should be end) and line 11 should be "onclicked()" or something like that.Line 11 should activate the function.and the extra ")" is to end the function

1 comment

0

That is not correct. That is a function he wrote himself, and it does not require a bracket to close it. The name of the function is in fact clickDetector.MouseClick.

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