Attempt to call a string value

image

Hello, in StarterGUI, there is a script that tells you how many blocks you have placed down. It errors (second error), and I do not know why.

Heres the local script inside StarterGUI:

game.ReplicatedStorage.TweenTransparency.OnClientEvent:Connect(function(len)
	script.Parent.Text = "+ " ..tostring(len) " letters"
	script.Parent.TextTransparency = 0
	script.Parent.Parent.PlusStep.UIStroke.Transparency = 0
	
	task.wait(2)
	
	local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
	local TweenService = game:GetService("TweenService")

	local anim = TweenService:Create(script.Parent, tweenInfo, {TextTransparency = 1})
	local anim2 = TweenService:Create(script.Parent.Parent.PlusStep.UIStroke, tweenInfo, {Transparency = 1})
	anim:Play()
	anim2:Play()
end)

Does anyone know why this is happening? Thanks!

If you could tell me, which line is erroring?

Might be because len is nil.

The second line; where it says tostring(len)…

You forgot to concatenate “Letters.”

2 Likes

How would I make it so that it isn’t nil? I mean it just stopped working when I play tested it. It worked like 1 week ago and I didn’t change any scripts…

Oops… LOL I don’t know how i missed this, there was no error in the script handler. Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.