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

guiText.Text = " Points: " ..points.Value Why won't this line work for me?

guiText = game.StarterGui.PointDisplay.BackGround.TextLabel
box = script.Parent.Box
points = game.StarterPack.Points
function onClick()
	box.Transparency = 1
	box.CanCollide = false
	points.Value = points.Value + 1
	guiText.Text = "  Points: " ..points.Value
	box:Destroy()
end
box.ClickDetector.MouseClick:connect(onClick)

I was trying to make some sort of point system on Roblox but line 8(guiText.Text = " Points: " ..points.Value)won't run. My gui won't change at all. There are no errors in the output(Probably a small detail I didn't see). Is there a way I can make this work?

1 answer

If the script is in the StarterGui, you can try this:

guiText = script.Parent.PointDisplay.BackGround.TextLabel

instead of:

guiText = game.StarterGui.PointDisplay.BackGround.TextLabel

You cannot do "game.StarterGui" because each Player has their own GUI, so: game.Players.PlayerGui

2 comments

0

Oh ok thanks a lot.

0

It's game.Players.LocalPlayer.PlayerGui

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