Attempt to call a nil value

Script:

Error:

(line 25 is the 3rd line)

‘StageNotificationUI’ is a string.

yeah but i need to :TweenSize it

A string is not a UI object. TweenSize is a method to change the size of a UI object over time.

A string is just a data type that is text. It’s not a UI object that is being rendered with a size. You are thinking of a TextLabel.

why are you attempting to tween the size of a string? the string is not a UI object. it’s just text. if you want to tween the size of a text gui, then tween the size of a textlabel.

i am trying to tween the size of a textlabel

You have to TweenSize the label you put it in not ‘it’ as its just a string not something visible on your screen.

You can’t change text you have to change what displays the said text and you also need to put that text on something to see it like a TextLabel inside a ScreenGui.

it doesn’t seem that you have a textlabel to tween, though. I suggest setting the Text of a TextLabel to the string, and then tweening the size of the TextLabel. The TextLabel is a UI object

Is ‘StageNotificationUI’ a TextLabel?

yes the variable is set to a textlabel

you are setting StageNotificationUI to "Stage " … StageReached … “Reached!”

this is setting it to a string.

You may have set StageNotificationUI to a TextLabel earlier, but it is now a string.

instead of
StageNotificationUI = "Stage " .. StageReached .. "Reached!"
do
StageNotificationUI.Text = "Stage " .. StageReached .. "Reached!"

1 Like

If ‘StageNotificationUI’ is a TextLabel doing StageNotificationUI = StringHere will just set the variable called “StageNotificationUI” to “StringHere”.

What you’re suppose to do is this:

StageNotificationUI.Text = StringHere

StageNotificationUI.Text means the Text StageNotificationUI displays.

1 Like

try changing the top part to

StageNotificationEvent.OnClientEvent:Connect(function(player, StageReached)

if that doesnt work than the issue is StageReached

Show me the serverScript that fires the remote

It doesn’t take the player it’s OnServerEvent which takes the player, this won’t work.

Try replacing StageNotificationUI with StageReached on the 2 TweenSize functions.
I also suggest you to use UI services in a localscript rather than in global.